IRC-Galleria

arafat

arafat

Pekka Puupää

Selaa blogimerkintöjä

aargh. on my own i would love to have been able to say on title, but maybe...

heheh. so give me some space for making public the source of all txt-based games to be :P

an example:

toiminnto (actions)
Toiminnot ovat pelaajan keino vaikuttaa ympäristöönsä. Periaatteessa kaikilla olioilla,
joita ympäristössä voi esiintyä. on toimintoja, joita käyttäjät voivat käynnistellä. Osa
olioista ei vältämättä ole näkyvissä kaikille käyttäjille, jolloin myöskään toiminnon
käynnistäminen ei ole mahdolista.

saapuessaan uuteen ymnpäristöön, pelaaja:
- saa ympäristökseen (environment) huoneen, johon hän siirtyi
- listataan subjektiksi mahdollisille toiminnoille, joita
ympäristössä olevat objektit voivat suorittaa

komennon parsinta

objektin tarkastelu
objektin katsominen
objektin sisään katsominen
objektin siirtely
objektin ottaminen jostakin/joltakin
objektin laittaminen johonkin/jollekin
objektin kanssa toimiminen
objektilla suoritetaan toiminto
objektille suoritetaan toiminto
objektin avaaminen/sulkeminen
objektilla suoritetaan toiminto kohdeobjektille


look
look at box
look into box

get box
get dagger from box
buy dagger for mihkali

put dagger from box into bag


Havupuumetsä
Maa on kostean ja pehmeän sammaleen peittämä.
Kasvillisuus on runsasta ja rehevää.
Metsä käy synkemmäksi ja tiheämmäski pohjoista kohti.
Etelän suunnalta kuuluu lintujen laulua.
Heikkot polun jäljet johtavat lännestä itään.
Raika, heikko tuuli käy pohjoisesta.

Forest
Ground is largely covered by soft, moist moss. There are lots of
plants growing well. The forest gets darker and thiker towrards north.
From south some bird singing can be heard. Sligth marks of something
what once was a path lead from west to east. Slight, fresh breeze
blows from north. There is an enermousyly large oak standing reaching
for the sky.
Obvious exits are: north, northwest, east, southeast, south, southwest,
west and northwest.

FFFFFFF Forest
FFFFFFF Ground is largely covered by soft, moist moss. There are
FFFFFFF lots of plants growing well. The forest is getting darker and
FFFFFFF thiker towrards north. From south some bird singing can
FFFFFFF be heard. Faint marks of something what once was a path
ffffFFF leading from west to east. Slight, fresh breeze blows from
FfffffF north. There is an enermousyly large oak standing reaching
for the sky.
Obvious exits are: north, northeast, east, southeast, south,
southwest, west and northwest.
A Cro-magnon sitting, a sprite and a zombie standing.
A group chasing a rabbit. Another group beating a worm and a minotaur
abusing the cow.
On ground you can see couple of logs, few coins and an axe.

verbs:
is, are, gets, singing, heard, leading, blows, standing, sitting, beating,
abusing, see

nouns:
forest, ground, moss, plant(s), north, south, bird, marks, path, west,
east, wind, oak, sky, northeast, southeast, southwest, northwest,
cro-magnon, sprite, zombie, group(s), rabbit, worm, minotaur, cow,
log(s), coin(s), axe

adjectives:
soft, moist, well, dark, thik, faint, slight, enermous, large


em oli vuodelta 2003 tms tämä jäljempi on vuodelta 1996 tms.


/* living.c
*
* every living object (player,npc,what ever) inhertis this
*/

inherit WALK;

/*
string name;
string full_name;
string alias_name;
*/
int level;
int alignment;
int sex; /* 0=other, 1=male, 2=female */
string race;
int experience;
int heart_beat; /* call out delay */
int heart_handle; /* call out handle */
int alive; /* 0 if this living is dead */

int max_hp;
int hp;

int max_sp;
int sp;

int max_ep;
int ep;

object natural_weapone;
/*
string *skills;
string *spells;
string *resistances;
*/
string *slots;
string *limbs;

mapping skills;
mapping spells;
mapping resistances;
mapping immunities;
mapping diseases;

mapping wielding; /* string index (string *limbs) : object weapon */
mapping equipment; /* string index (string *slots) : object armour */
mapping stats; /* string index : int value */
private mapping racial_stats;
int racial_wc;

string msg_say;
string msg_in;
string msg_out;

object combat; /* combat object this living is in */

object primary_target;
object *targets;
int present_targets;

Reset() {
set_name("base living");
race = "";
/* level, alignment, sex = 0 */
slots = ({});

skills = ([]);
spells = ([]);
resistances = ([]);
immunities = ([]);
diseases = ([]);
equipment = ([]);
stats = ([]);
racial_stats = ([]);

msg_say = "says";
msg_in = "arrives";
msg_out = "leaves";
}


/* prototypes*/
nomask int stat(string s);
nomask int set_stat(string s, int i);
nomask string race(void);
/* end */

/*
* messages
*/
nomask string msg_say(void) { return msg_say; }
nomask string msg_in(void) { return msg_in; }
nomask string msg_out(void) { return msg_out; }

nomask string set_msg_say(string s) { return msg_say; }
nomask string set_msg_in(string s) { return msg_in; }
nomask string set_msg_out(string s) { return msg_out; }


/* writef()
* write a formatted string
* %o = object (living object will be capitalized as necessary)
*/
nomask void writef(string str, object *obj) {
int i,ii;
string t_str;

ARGCHECK(str, writef, 1);
ARGCHECK(obj, writef, 2);
/* if (sizeof(explode(str, "%o")) != (sizeof(obj)-1))
error("Arg size mismatch for writef()"+sizeof(explode(str,"%o"))+","+sizeof(obj)+"! ");
*/
t_str = "";
while (i < strlen(str)) {
if ((str == '%') && (i < strlen(str))) {
if (str[++i] == 'o') {
if (ii < sizeof(obj))
t_str += ((obj[ii]->living()) ? capitalize(obj[ii++]->name()) : obj[ii++]->name());
else
error("Bad argument 2 in writef()");
}
else
t_str += str[(--i)..i];
}
else
t_str += str[i..i];
i++;
}
this_player()->write(t_str);
}

/*
* do_put()
*
*/
void do_put(mixed item, mixed container) {
int i;
string s;
object i_obj, c_obj, *inv;

if (typeof(item) != T_STRING)
ARGCHECK(typeof(item) == T_OBJECT, put, 1);

if (typeof(container) != T_STRING)
ARGCHECK(typeof(container) == T_OBJECT, put, 2);

this_user()->echo("-- put()\n");

if (!(i_obj = posses(item)))
this_player()->echo("You don't have "+((typeof(item) == T_STRING) ? item : item->name())+".\n");

if (!(c_obj = present(container)))
this_player()->echo("You don't see "+((typeof(container) == T_STRING) ? container : container->name())+" here.\n");

if (c_obj && i_obj)
switch (Move(i_obj, c_obj)) {
case 1:
this_player()->echo("Object can't be moved inside itself!\n");
break;
case 2:
this_player()->echo(capitalize(c_obj->name())+" has no room for "+i_obj->name()+".\n");
break;
case 3:
this_player()->echo(capitalize(c_obj->name())+" can't carry "+i_obj->name()+".\n");
break;
default:
inv = environment()->inventory();
for (i = 0; i < sizeof(inv); i++)
/* check skill slip */
if ((object_type(inv) == "player") && (inv != this_object()))
if (inv->vision() > environment()->light())
inv->write(capitalize(name())+" puts "+i_obj->name()+" in "+c_obj->name()+".\n");
else if (inv->vision() >= (environment()->light()/2))
inv->write(capitalize(race())+" puts something in "+c_obj->name()+".\n");
else
inv->write("putti tapahtui (162:living.c)\n");
this_player()->write("You put "+i_obj->name()+" in "+c_obj->name()+".\n");
/* writef("%o puts %o in "+c_obj->name()+".\n", ({this_object(), i_obj}));
*/
break;
}
this_user()->echo("<-- put()\n");
}


/*
* do_drop()
*
*/
varargs void do_drop(mixed item, mixed container) {
int i,n;
string s;
object i_obj, c_obj, *inv;

if (typeof(item) != T_STRING)
ARGCHECK(typeof(item) == T_OBJECT, drop, 1);

this_user()->echo("-- drop()\n");

if (!(i_obj = posses(item)))
this_player()->echo("You don't have "+((typeof(item) == T_STRING) ? item : item->name())+".\n");
this_user()->echo("-- drop()\n");

if (container) {
if (typeof(container) == T_STRING) {
if (sscanf(container, "%s %d", s, n))
n = (n > 0) ? n : 1;
else
s = container;

if (!n)
n = 1;

inv = inventory(environment());
inv += inventory();
for (i = 0; i < sizeof(inv) && n; i++)
if (inv->match_name(s))
if (!--n)
c_obj = inv;
}
else {
ARGCHECK(typeof(container) == T_OBJECT, drop, 1);

}

if (!(c_obj = present(container)))
this_player()->echo("You don't see "+((container==T_STRING) ? container : container->name())+" here.\n");
}
else
c_obj = environment();
this_user()->echo(""+"\n");
this_user()->echo("item = "+item+"\n");
this_user()->echo("cont = "+((container) ? container : "NULL")+"\n");
this_user()->echo("i_obj ="+((i_obj) ? object_name(i_obj) : "NULL")+"\n");
this_user()->echo("c_obj ="+((c_obj) ? object_name(c_obj) : "NULL")+"\n");

if (!n && i_obj && c_obj)
switch (Move(i_obj, c_obj)) {
case 1:
this_player()->echo("Object can't be moved inside itself!\n");
break;
case 2:
/* muuta; jos full niin item pullahtaa environmenttiin */
this_player()->echo(capitalize(c_obj->name())+" has no room for "+i_obj->name()+".\n");
break;
case 3:
this_player()->echo(capitalize(c_obj->name())+" can't carry "+i_obj->name()+".\n");
break;
default:
inv = environment()->inventory();
for (i = 0; i < sizeof(inv); i++)
/* check skill slip, vaan dropissapa ei paljo slipit auta? */
if ((object_type(inv) == "player") && (inv != this_object()))
if (inv->vision() > environment()->light())
inv->write(capitalize(name())+" drops "+i_obj->name()+((c_obj != environment()) ? " in "+(c_obj->name())+".\n" : ".\n"));
else if (inv->vision() >= (environment()->light()/2))
inv->write(capitalize(race())+" drops something"+((c_obj != environment()) ? " in "+(c_obj->name())+".\n" : ".\n"));
else
inv->write("droppi tapahtui (248:living.c)\n");
this_player()->write("You drop "+i_obj->name()+((c_obj != environment()) ? " in "+(c_obj->name())+".\n" : ".\n"));
break;
}
this_user()->echo("<-- drop()\n");
}

/*
* do_take()
*/
varargs void do_take(mixed item, mixed container) {
int i,n;
string s;
object i_obj, c_obj, *inv;

if (typeof(item) != T_STRING)
ARGCHECK(typeof(item) == T_OBJECT, take, 1);

this_user()->echo("-- take()\n");

if (container) {
if (typeof(container) != T_STRING)
ARGCHECK(typeof(container) == T_OBJECT, take, 2);

if (!(c_obj = present(container)))
this_player()->echo("You don't see "+((typeof(container) == T_STRING) ? container : container->name())+" here.\n");

if (c_obj == this_object()) {
this_player()->echo("You already got it, haven't you?\n");
c_obj = 0;
}

}
else
c_obj = environment();
this_player()->echo("c_obj "+((c_obj)?object_name(c_obj):"NULL")+"\n");
if (!(i_obj = posses(item, c_obj)))
this_player()->echo("No "+((typeof(item) == T_STRING) ? item : item->name())+" in "+((c_obj == environment()) ? "here" : c_obj->name())+".\n");

if (i_obj && c_obj)
switch (Move(i_obj, this_object())) {
case 1:
this_player()->echo("Object can't be moved inside itself!\n");
break;
case 2:
this_player()->echo("It's too BIG.\n");
break;
case 3:
this_player()->echo("It's too heavy.\n");
break;
default:
inv = environment()->inventory();
for (i = 0; i < sizeof(inv); i++)
/* check skill slip */
if ((object_type(inv) == "player") && (inv != this_object()))
if (inv->vision() > environment()->light())
inv->write(capitalize(name())+" takes "+i_obj->name()+((c_obj != environment()) ? " from "+(c_obj->name())+".\n" : ".\n"));
else if (inv->vision() >= (environment()->light()/2))
inv->write(capitalize(race())+" takes something"+((c_obj != environment()) ? " from "+(c_obj->name())+".\n" : ".\n"));
else
inv->write("taikki tapahtui (316:living.c)\n");
this_player()->write("You took "+i_obj->name()+((c_obj != environment()) ? " from "+(c_obj->name())+".\n" : ".\n"));
break;
}

this_user()->echo("-- take()\n");
}


/************************/
/* COMBAT - OBJ version */
/************************/
object combat(void) { return combat; }

void rm_combat() {
if (combat && (previous_object() == combat)){
this_object()->echo(object_name(this_object())+"combat debug! removed from combat\n");
combat = 0;
}
else if (combat && (object_type(previous_object()) == "combat")) {
/* combat = 0;*/
this_object()->echo("combat debug! fighting in "+object_name(combat)+"\n");
}
else if (combat)
error(object_name(previous_object())+" can't remove combat ");
}
void set_combat(object o) {
if (!combat || (object_type(previous_object()) == "combat")) {
this_object()->echo("combat debug! combat set to "+object_name(o)+(!combat)?"":" (override)"+".\n");
combat = o;
}
else
error ("Combat object already set!");
}
void set_target(object o) {
if (!primary_target)
primary_target = o;
else
/* this error occurs if you tried to attack your self */
error ("Primary target already set to "+object_name(primary_target)+" !");
}
void add_target(object o) {
int i;

if (!targets) {
targets = allocate(1);
targets[0] = o;
}

}
/*
* killi()
*
* does not support non-player characters !
*/
varargs void killi(string tstr,int i) {
object tgt;

if (!(tgt = environment()->FindItem(tstr,i))) {
this_player()->echo("Kill what? I see no "+tstr+" here.\n"); return; }

if (tgt == this_object()) {
this_player()->echo("Usage: suicide <password>\n"); return; }

if (combat) {
if (environment(combat) == environment()) {
if (!(combat->present_players()) && !(combat->present_npcs()))
combat->join_to_combat(tgt);
else
this_user()->echo("Doh! You are busy enough with your current opponents.\n");
}
else {
combat = 0;
start_combat(tgt);
}
}
else
start_combat(tgt);
}
/* COMBAT OBJ version ENDS */

/*
* damage this living with *hit
* return: 0 if hit was avoided,
* 0 <= damage done to this living
* 0 >= damage was absobed in armour
*/
int damage(mixed *hit) {
int resist, hurtme;

/*
if (object_type(previous_object()) != "combat") {
this_user()->echo("debug: damage(): not a combat object\n");
return 0;
}
*/
/* generally type reisist is a racial thing or an enchantment */
if (resistances[hit[0]]) /* resistance to type */
resist = resistances[hit[0]];

/* resistance to methond depends on armour */
/* thus it will be added after armours can be worn */
if (resistances[hit[1]]) /* resistance to method */
resist += resistances[hit[1]];

if (hit[2] < ( (random(stats["agi"]) + random(100-stats["siz"])) / 4) )
return 0;

if ((hurtme = hit[3] - resist) > 0)
hp -= hurtme;

return hurtme;
}

/* RETURN *mixed ([string type, string method, int hit, int dam]...)
* return damage object
* returned object will tell how many attacks this object has,
* attack types, battle message, hit chance and damgae done if hit
*
* example {["physical","pound",20,3],["poison","bite",20,3]}
*/
mixed *hit(void) {
int atck, pen, right_hit, right_dam, left_hit, left_dam;
object r_hand, l_hand;
/*
if (object_type(previous_object()) != "combat") {
this_user()->echo("debug: hit(): not a combat object\n");
return;
}
*/
r_hand = wielding["right hand"];
l_hand = wielding["left hand"];

if (skills["attack"])
atck = skills["attack"];
if (skills["offhand penalty"])
pen = skills["offhand penalty"];

right_hit = atck + stats["agi"]/4 + wielding["right hand"]->hit();
right_dam = wielding["right hand"]->dam() + stats["str"]/4;

left_hit = (int) ((float)(stats["agi"]/4 +
atck + wielding["left hand"]->hit()) *
(float)((pen < 50) ? (50.0 + (float)pen) / 100.0 : 1.0));
left_dam = (int) ((float)(wielding["left hand"]->dam() + stats["str"]/4) *
(float)((pen < 50) ? (50.0 + (float)pen) / 100.0 : 1.0));

return ({r_hand->damage_type(),r_hand->damage_method(),right_hit,right_dam,
l_hand->damage_type(),l_hand->damage_method(),left_hit,left_dam});

this_user()->echo("attack:"+atck+"\n");
this_user()->echo("offhand:"+pen+"\n");
this_user()->echo("right hit:"+right_hit+"\n");
this_user()->echo("right dam:"+right_dam+"\n");
this_user()->echo("left hit:"+left_hit+"\n");
this_user()->echo("left dam:"+left_dam+"\n");
}

/*******COMBAT******/
/*
void add_target(object o) {
int i,isiz;
object *tlist;

if (!targets) {
targets = allocate(1);
targets[0] = o;
} else {
tlist = allocate((isiz = sizeof(targets)+1));
tlist[0] = o;
for (i = 1; i < isiz; i++)
tlist = targets[i-1];
targets = tlist;
}
this_player()->echo("add_target(\""+object_name(targets[0])+"\")!!!!!!!\n");
}

/***/
/*
void combat_round(void) {
int i,ii,isiz,tosiz;
object *to;
mixed hits;
this_object()->echo("combat debug: ** NEW ROUND **\n");

if (!targets)
targets = ({});

if ((object_type(this_object()) == "player") && (isiz = sizeof(targets))) {
to = allocate(tosiz=sizeof(targets));
for (i = 0; i < tosiz; i++)
if (environment->posses(targets))
to[ii++] = targets;
targets = to;
present_targets = ii;
}

this_object()->echo("present targets:"+ii+"\n");

if (!present_targets) {
primary_target = 0;
return;
}

if (!(environment->posses(primary_target))) {
this_object()->echo("getting new primary target.\n");
primary_target = targets[random(ii)];
}
this_object()->echo("primary target :"+object_name(primary_target)+"\n");

if (sizeof(hits = hit()) == 0)
return;

if ((sizeof(hits) % 4) != 0)
return;

for (i = 0; i < sizeof(hits)/4; i++) {
ii = primary_target->damage(hits[(i*4) .. (i*4+3)]);

if (object_type(this_object()) == "player")
this_object()->echo(primary_target->name()+" sai "+ii+" tehon "+hits[i*4+1]+"\n");
if (object_type(primary_target) == "player")
primary_target->echo(name()+" loi "+ii+" "+hits[i*4+1]+"\n");
}

call_out("combat_round",2);
}
*/
/*******COMBAT******/
/*******COMBAT******/
/*
varargs void kill(string opponent, int i) {
object obj;

if (obj == this_object()) {
if (object_type(this_object()) == "player")
this_object()->echo("noin tyhma nyt kai kukaan vois olla?\n");
return;
}

if ((object_type(this_object()) == "player") && primary_target) {
this_player()->echo("You are already fighting.\n");
return;
}

if ((obj = environment->FindItem(opponent,i)) == 0) {
if (object_type(this_object()) == "player")
this_player()->echo("ei "+opponent+" loydy.\n");
return;
} else if (obj == this_object()) {
if (object_type(this_object()) == "player")
this_object()->echo("noin tyhma nyt kai kukaan vois olla?\n");
return;
}

if (!(environment->posses(obj))) {
if (object_type(this_object()) == "player")
this_player()->echo("No "+obj->name()+" here.\n");
return;
}

primary_target = obj;
add_target(obj);
call_out("combat_round",1);
return;

if (obj->combat()) {
(obj->combat())->add_to_combat(this_object());
}
else {
combat = clone_object("/dgd/std/combat");
combat->start_combat(this_object());
combat->add_to_combat(obj);
}
}
*/

/* HP */
nomask int hp(void) { return hp; }
nomask int adj_hp(int i) { return hp += i; }

nomask int max_hp(void) { return max_hp; }
nomask int set_max_hp(void) {
max_hp = stat("size")+stat("sta")+ (int) (racial_stats["sta"] * (float) level);
}

/* SP */
nomask int sp(void) { return sp; }
nomask int adj_sp(int i) { return sp += i; }

nomask int max_sp(void) { return max_sp; }
nomask int set_max_sp(void) {
max_sp = stat("wis")+stat("int") +(int) (racial_stats["wis"] *(float) level);
}

/* EP */
nomask int ep(void) { return ep; }
nomask int adj_ep(int i) { return ep += i; }

nomask int max_ep(void) { return max_ep; }
nomask int set_max_ep(void) {
max_ep = stat("agi")+stat("sta") + (int) (racial_stats["sta"] *(float) level);
}

nomask void set_stats(void) {
int i,isize; string *slist;

isize = sizeof(slist = map_indices(racial_stats));
for (i = 0; i < isize; i++)
stats[slist] = (int) (racial_stats[slist] * (float) level);
}

/* levels and alignment */
nomask int level(void) { return level; }
nomask int alignment(void) { return alignment; }

nomask int set_level(int i) { return level = i; }
nomask int set_alignment(int i) { return alignment = i; }

/*
* HEART
*/
nomask heart_beat(void) { error("living.c:heart_beat():638: not used");/*return heart_beat;*/ }
static void heart(void) {
int ohp,osp,oep;

ohp = hp; osp = sp; oep = ep;

if (ep < max_ep)
ep += 1 + stats["sta"] / 100;

if (ep > 0) {
if (sp < max_sp) {
sp += 1 + stats["int"] / 30 + stats["wis"] / 20;
ep--;
}
if (hp < max_hp) {
hp += 1 + stats["sta"] / 100;
ep--;
}
}

/* sc fake */

if ((object_type(this_object()) == "player") && (oep != ep | osp != sp | ohp !=hp))
this_object()->echo("hp:"+hp+" sp:"+sp+" ep:"+ep+"\n");

heart_handle = call_out("heart",heart_beat);
}


/*
* describe (sex, pronoun, condition, shape...)
*/
nomask string sex(void) {
return (sex==0) ? "other" : (sex==1) ? "male" : "female"; }
nomask string pronoun(void) {
return (sex==0) ? "it" : (sex==1) ? "he" : "she"; }
nomask string possessive(void) {
return (sex==0) ? "its" : (sex==1) ? "his" : "her"; }
nomask string objective(void) {
return (sex==0) ? "it" : (sex==1) ? "him" : "her"; }

nomask string set_sex(string s) {
sex = (s=="male") ? 1 : ((s=="female") ? 2 : 0);
return sex();
}

nomask string condition() {
if (hp < 0)
return capitalize(name())+" is unconscious and bleeding from big wounds.";
else if (hp <= max_hp/10)
return capitalize(name())+" is covered by "+possessive()+" own blood.";
else if (hp <= max_hp/2)
return capitalize(name())+" body is covered by bruises.";
else
return capitalize(name())+" looks fit and healthy.";
}

string statstring(string s) {
int i;
string str,sc;

str = capitalize(s)+": ";

if (stats < 10)
str += " ";
else if (stats < 100)
str += " ";

return str += stats+" ";
}

void scores(void) {
this_user()->echo("Name: "+capitalize(name())+" the "+race+"\n");
this_user()->echo("

\n");
this_user()->echo("Level: "+((level<10)?" ":" ")+level+
" Experience: "+experience+"\n\n" );
this_user()->echo("Hp: "+hp+" ("+max_hp+
") Sp: "+sp+" ("+max_sp+") Ep: "+ep+" ("+max_ep+")\n\n");
this_user()->echo(statstring("str")+statstring("agi")+statstring("siz")+statstring("cha")+"\n");
this_user()->echo(statstring("wis")+statstring("int")+statstring("sta")+"\n");
this_user()->echo("
\n");
}

/*
* NAME
*/
/*
nomask string name(void) { return name; }
nomask string full_name(void) { return full_name; }
nomask string alias_name(void) { return alias_name; }

nomask void set_name(string s) { name = full_name = alias_name = s; }
nomask void set_full_name(string s) { full_name = s; }
nomask void set_alias_name(string s) { alias_name = s; }
*/
/*
* RACE
*/
nomask string race(void) { return race; }

nomask void set_race(string s) {

/* varmista et race on validi */
if (!race)
race = s;
else if (race != s)
return;

if (race == "visitor") {
/* guest special save/restore */
restore_object("/var/obj/visitor");
alignment++;
save_object("/var/obj/visitor");
set_name("guest-"+alignment);
stats = (["str":1, "agi":1, "int":1, "wis":1,
"cha":1, "sta":1, "siz":1]);
racial_stats = (["str":1.0, "agi":1.0, "int":1.0, "wis":1.0,
"cha":1.0, "sta":1.0, "siz":1.0]);

heart_beat = 1;
msg_say = "meeps";
msg_in = "arrives";
msg_out = "leaves";
}
else if (race == "giant") {
stats = (["str":1, "agi":1, "int":1, "wis":1,
"cha":1, "sta":1, "siz":1]);
racial_stats = (["str":2.0, "agi":0.5, "int":0.1, "wis":0.1,
"cha":0.75, "sta":2.0, "siz":2.5]);

heart_beat = 1;
msg_say = "booms";
msg_in = "arrives";
msg_out = "leaves";
}
else if (race == "sprite") {
stats = (["str":1, "agi":1, "int":1, "wis":1,
"cha":1, "sta":1, "siz":1]);
racial_stats = (["str":0.1, "agi":2.5, "int":1.5, "wis":1.5,
"cha":1.75, "sta":0.5, "siz":0.3]);

heart_beat = 1;
msg_say = "meaowls";
msg_in = "arrives";
msg_out = "leaves";
}
resistances = ([]);
alive = 1;
level=1;

skills = ([]);
/*skills["attack"] = 10;
*/
natural_weapone = clone_object("/obj/weapone/bludgeon");

slots = ({"head", "neck", "left arm", "right arm",
"left hand", "right hand", "torso", "belt",
"left leg", "right leg", "left foot", "right foot"});
limbs = ({"right hand", "left hand"});

wielding = ([]);
wielding["right hand"] = natural_weapone;
wielding["left hand"] = natural_weapone;


set_stats();
set_max_hp();
set_max_sp();
set_max_ep();
/* heart();*/
}

/*
* stats
*/
nomask int stat(string s) { return (!stats) ? 0 : stats; }

nomask int adj_stat(string s, int i) {
/* logga stat change */
/* ja adjustia adjustoidaan race tunella */
stats += i;
/* pida huoli et ei mee alle 1 kun naa mapit on mita on */
}

/*
* spells
*/
nomask string *spells(void) {
if (map_sizeof(spells) == 0)
return ({});
else
return map_indices(spells);
}

nomask varargs int skill(string s) {
if (!skills)
return 0;
else
return skills;
}

/*
* skills
*/
nomask string *skills(void) {
if (map_sizeof(skills) == 0)
return ({});
else
return map_indices(skills);
}

nomask varargs int spell(string s) {
if (!spells)
return 0;
else
return spells;
}


Etkö vielä ole jäsen?

Liity ilmaiseksi

Rekisteröityneenä käyttäjänä voisit

Lukea ja kirjoittaa kommentteja, kirjoittaa blogia ja keskustella muiden käyttäjien kanssa lukuisissa yhteisöissä.