inherit "obj/treasure"; string short_desc, name, message; int value, strength, heal; int full; int cracked; id(str) { return str=="champagne" || str=="bottle" || str=="bubbly"; } short() { if(!full) return "An empty bottle"; if(cracked) return "A bottle of Jubal's Finest Champagne (cracked)"; return "A bottle of Jubal's Finest Champagne"; } query_value() { return 0; } long() { if(!full) write(""); write(short() + ".\n"); write("You can crack the bottle before you drink it!\n"); } reset(arg) { if (arg) return; strength = 3; full = 1; cracked = 0; } drink(str) { int rand, npc; string p_name; if (str && !id(str)) return 0; if (!full) return 0; write("You drink some bubbly champagne.\n"); say(this_player()->query_name() + " drinks some champagne.\n"); full=0; rand=random(5); if (rand==2 || rand==3 || rand==4) call_out("tell_em", random(6)); else destruct(this_object()); return 1; } tell_em() { int rand; rand=random(15); if(rand==3) { write("You dance around with a lampshade on your head.\n"); say(this_player()->query_name() + " dances around with a lampshade on " + this_player()->query_possessive() + " head.\n"); } if(rand==4) { write("The room spins around and you fall down.\n"); say(this_player()->query_name() + " falls down on the ground.\n"); } if(rand==5) { write("You dance with yourself.\n"); say(this_player()->query_name() + " waltzes around the floor with "+this_player()->query_objective() + "self.\n"); } if(rand==6) { write("You giggle uncontrollable.\n"); say(this_player()->query_name() + " giggles uncontrollably\n"); } if(rand==7) { write("You begin to feel silly.\n"); say(this_player()->query_name() + " begins to feel silly\n"); call_out("tell_em",2); return 1; } if(0) { write("You toast Jezz and Jubal.\n"); say(this_player()->query_name() + " toasts Jezz and Jubal.\n"); destruct(this_object()); } if(rand==14) { write("You twirl around and around and then fall down.\n"); say(this_player()->query_name() + " twirls around and around and then falls down!\n"); destruct(this_object()); } say(this_player()->query_name() + " looks silly.\n"); } crack() { if (cracked) return 0; write("You crack open the champagne!\n"); say(this_player()->query_name() + " cracks open a bottle of champagne!\n"); call_out("crack2",1); cracked=1; return 1; } crack2() { write("You are all drenched with the bubbly!\n"); say("You are all drenched with the bubbly!\n"); return 1; } init() { if(environment()==this_player()) { add_action("drink", "drink"); add_action("crack", "crack"); } } query_weight() { return 0; } drop() { if(!full) { write("The empty bottle hits the ground and shatters.\n"); destruct(this_object()); return 1; } return 0; }