I think I will get things started here in the vault by making a puddle...
Um... a code puddle that is.
I had heard a request on drinkable puddles that used the 'drink' verb from somewhere and that got my wheels to turning.
This is an object that will work in the normal ds2.1 that has not had its lib to heavilly modified I believe.
We could move it in when a bottle breaks, after a rain storm, etc.
I plan on working it up to being a lib object that could be configured on the fly.
Code Start-
/* /domain/whatever/obj/puddle.c
* from the Dead Souls 2.1
* provides drinkable puddle for room inventory
* or -moves to room- to allow drink verb usage.
* Memrosh@Ascension
* September 10, 2006
*/
#include <lib.h>
#include <meal_types.h>
inherit LIB_ITEM;
int pud_size = 10;
int GetMealType(){ return MEAL_DRINK; }
int GetStrength(){ return 1;}
int eventDestruct() { return item::eventDestruct(); }
void Lesson_Me(){
pud_size --;
if(pud_size < 1){ Destruct();}
}
static void create() {
item::create();
SetKeyName("puddle");
SetId("puddle","water");
SetAdjectives("cool");
SetShort("a puddle");
SetLong("This is a puddle of water.");
}
mixed direct_drink_obj(){
return (int)this_player()->CanDrink(this_object());
}
mixed direct_drink_from_obj(){
return (int)this_player()->CanDrink(this_object());
}
mixed CanGet(object ob) {
send_messages( "run","$agent_name $agent_verb $agent_possessive "+
"fingers through $target_name.",this_player(),this_object(),
environment());
return "You can not physically take a puddle.";
}
mixed eventDrink(object who){
send_messages("drink","$agent_name $agent_verb from a puddle.",
who,0,environment(who));
who->eventDrink(this_object());
Lesson_Me();
return 1;
}
void init(){
::init();
}
-Code End
Please feel free to discuss, rip, advance, etc.
I also have an invis 'dummy' stream that will do the same except wont dry up.
Memrosh
ps: seems the board does not like spaces or tabs at the left.