Skip to content

Commit

Permalink
Random message now occasionally printed when smoking weed
Browse files Browse the repository at this point in the history
Can now cancel smoking weed from pipe/joint menu
  • Loading branch information
TranquilMarmot committed Apr 3, 2014
1 parent a388212 commit 69d0a0a
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 7 deletions.
1 change: 1 addition & 0 deletions SIGNOFF
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ Vidar Engh Skaugen <[email protected]>
Brandon Bergren (Bdragon) <[email protected]> / <[email protected]>
Henrik "Tivec" Bergvin <[email protected]>
FryCarson <[email protected]>
TranquilMarmot (Nate Moore) <[email protected]>
122 changes: 122 additions & 0 deletions src/disease.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,128 @@ void dis_msg(dis_type type_string) {
}
}

void weed_msg(player *p) {
p->add_effect("speed_boost", 10);
int howhigh = p->disease_duration("weed_high");
int smarts = p->get_int();
if(howhigh > 125 && one_in(7)) {
int msg = rng(0,5);
switch(msg) {
case 0: // Freakazoid
g->add_msg_if_player(p, _("The scariest thing in the world would be... if all the air in the world turned to WOOD!"));
return;
case 1: // Simpsons
g->add_msg_if_player(p, _("Could Jesus microwave a burrito so hot, that he himself couldn't eat it?"));
p->hunger += 2;
return;
case 2:
if(smarts > 8) { // Timothy Leary
g->add_msg_if_player(p, _("Science is all metaphor."));
} else if(smarts < 3){ // It's Always Sunny in Phildelphia
g->add_msg_if_player(p, _("Science is a liar sometimes."));
} else { // Durr
g->add_msg_if_player(p, _("Science is... wait, what was I talking about again?"));
}
return;
case 3: // Dazed and Confused
g->add_msg_if_player(p, _("Behind every good man there is a woman, and that woman was Martha Washington, man."));
if(one_in(2)) {
g->add_msg_if_player(p, _("Every day, George would come home, and she would have a big fat bowl waiting for him when he came in the door, man."));
if(one_in(2)) {
g->add_msg_if_player(p, _("She was a hip, hip, hip lady, man."));
}
}
return;
case 4:
if(p->has_amount("money_bundle", 1)) { // Half Baked
g->add_msg_if_player(p, _("You ever see the back of a twenty dollar bill... on weed?"));
if(one_in(2)) {
g->add_msg_if_player(p, _("Oh, there's some crazy shit, man. There's a dude in the bushes. Has he got a gun? I dunno!"));
if(one_in(3)) {
g->add_msg_if_player(p, _("RED TEAM GO, RED TEAM GO!"));
}
}
} else if(p->has_amount("holybook_bible", 1)) {
g->add_msg_if_player(p, _("You have a sudden urge to flip your bible open to Genesis 1:29..."));
} else { // Big Lebowski
g->add_msg_if_player(p, _("That rug really tied the room together..."));
}
return;
case 5:
g->add_msg_if_player(p, _("I used to do drugs... I still do, but I used to, too."));
default:
return;
}
} else if(howhigh > 100 && one_in(5)) {
int msg = rng(0, 5);
switch(msg) {
case 0: // Bob Marley
g->add_msg_if_player(p, _("The herb reveals you to yourself."));
return;
case 1: // Freakazoid
g->add_msg_if_player(p, _("Okay, like, the scariest thing in the world would be... if like you went to grab something and it wasn't there!"));
return;
case 2: // Simpsons
g->add_msg_if_player(p, _("They call them fingers, but I never see them fing."));
if(smarts > 2 && one_in(2)) {
g->add_msg_if_player(p, _("... oh, there they go."));
}
return;
case 3: // Bill Hicks
g->add_msg_if_player(p, _("You suddenly realize that all matter is merely energy condensed to a slow vibration, and we are all one consciousness experiencing itself subjectively."));
return;
case 4: // Steve Martin
g->add_msg_if_player(p, _("I usually only smoke in the late evening."));
if(one_in(4)) {
g->add_msg_if_player(p, _("Oh, occasionally the early evening, but usually the late evening, or the mid-evening."));
}
if(one_in(4)) {
g->add_msg_if_player(p, _("Just the early evening, mid-evening and late evening."));
}
if(one_in(4)) {
g->add_msg_if_player(p, _("Occasionally, early afternoon, early mid-afternoon, or perhaps the late mid-afternoon."));
}
if(one_in(4)) {
g->add_msg_if_player(p, _("Oh, sometimes the early-mid-late-early-morning."));
}
if(smarts > 2) {
g->add_msg_if_player(p, _("...But never at dusk."));
}
return;
case 5:
default:
return;
}
} else if(howhigh > 50 && one_in(3)) {
int msg = rng(0, 5);
switch(msg) {
case 0: // Cheech and Chong
g->add_msg_if_player(p, _("Dave's not here, man."));
return;
case 1: // Real Life
g->add_msg_if_player(p, _("Man, a cheeseburger sounds SO awesome right now."));
p->hunger += 4;
if(p->has_trait("VEGETARIAN")) {
g->add_msg_if_player(p, _("Eh... maybe not."));
} else if(p->has_trait("LACTOSE")) {
g->add_msg_if_player(p, _("I guess, maybe, without the cheese... yeah."));
}
return;
case 2: // Dazed and Confused
g->add_msg_if_player(p, _("Walkin' down the hall, by myself, smokin' a j with fifty elves."));
return;
case 3: // Half Baked
g->add_msg_if_player(p, _("That weed was the shiz-nittlebam snip-snap-sack."));
return;
case 4:
weed_msg(p); // re-roll
case 5:
default:
return;
}
}
}

void dis_end_msg(player &p, disease &dis)
{
switch (disease_type_lookup[dis.type]) {
Expand Down
2 changes: 2 additions & 0 deletions src/disease.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class game;

void dis_msg(dis_type type);

void weed_msg(player *p);

void dis_end_msg(player &p, disease &dis);

void dis_remove_memorial(dis_type type);
Expand Down
16 changes: 9 additions & 7 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "line.h"
#include "mutation.h"
#include "player.h"
#include "disease.h"
#include "vehicle.h"
#include "uistate.h"
#include "action.h"
Expand Down Expand Up @@ -1016,20 +1017,17 @@ int iuse::weed(player *p, item *it, bool b) {
p->pkill *= 2;
}

bool rollJoint = false;
int choice = -1;
if(hasPipe && hasPapers) { // ask whether to roll a fatty or pack a bowl
int choice = -1;
choice = menu(true, _("Do what with cannabis?"), _("Roll a joint"), _("Smoke a pipe"), NULL);
if(choice < 0) {
choice = menu(true, _("Do what with cannabis?"), _("Roll a joint"), _("Smoke a pipe"), _("Cancel"), NULL);
if(choice < 0 || choice == 3) {
g->add_msg_if_player(p, _("Never mind."));
return 0;
} else if(choice == 1) {
rollJoint = true;
}
}

// smoke a joint (call iuse::cig)
if (rollJoint || !hasPipe) {
if ((choice == 1) || !hasPipe) {
p->use_charges_if_avail("rolling_paper", 1);
return cig(p, it, b);
}
Expand All @@ -1049,9 +1047,13 @@ int iuse::weed(player *p, item *it, bool b) {
}
p->add_disease("weed_high", duration);
p->moves -= 40;
// breathe out some smoke
for(int i = 0; i < 3; i++) {
g->m.add_field(p->posx + int(rng(-2, 2)), p->posy + int(rng(-2, 2)), fd_weedsmoke, 2);
}
if(one_in(3)) {
weed_msg(p);
}
return it->type->charges_to_use();
}

Expand Down
1 change: 1 addition & 0 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6405,6 +6405,7 @@ bool player::process_single_active_item(item *it)
} else { // joint
this->add_disease("weed_high", 10); // one last puff
g->m.add_field(this->posx + int(rng(-1, 1)), this->posy + int(rng(-1, 1)), fd_weedsmoke, 2);
weed_msg(this);
it->make(itypes["joint_roach"]);
}
it->active = false;
Expand Down

0 comments on commit 69d0a0a

Please sign in to comment.