2010-12-02 12:17:54 +11:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include "defs.h"
|
|
|
|
#include "flag.h"
|
2011-02-01 06:16:13 +11:00
|
|
|
#include "io.h"
|
|
|
|
#include "lf.h"
|
|
|
|
#include "objects.h"
|
2011-03-22 18:06:28 +11:00
|
|
|
#include "spell.h"
|
2010-12-02 12:17:54 +11:00
|
|
|
#include "text.h"
|
|
|
|
|
2011-03-18 12:25:18 +11:00
|
|
|
extern enum GAMEMODE gamemode;
|
2011-02-16 05:21:33 +11:00
|
|
|
extern int needredraw;
|
|
|
|
extern int statdirty;
|
2011-02-01 06:16:13 +11:00
|
|
|
|
2011-03-16 15:45:46 +11:00
|
|
|
extern lifeform_t *player;
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
flag_t *addflag(flagpile_t *fp, enum FLAG id, int val1, int val2, int val3, char *text) {
|
2011-02-16 05:21:33 +11:00
|
|
|
return addflag_real(fp, id, val1, val2, val3, text, PERMENANT, B_KNOWN, -1);
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
flag_t *addtempflag(flagpile_t *fp, enum FLAG id, int val1, int val2, int val3, char *text, int timeleft) {
|
2011-02-16 05:21:33 +11:00
|
|
|
return addflag_real(fp, id, val1, val2, val3, text, timeleft, B_KNOWN, -1);
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
|
2011-02-16 05:21:33 +11:00
|
|
|
flag_t *addflag_real(flagpile_t *fp, enum FLAG id, int val1, int val2, int val3, char *text, int lifetime, int known, long obfromid) {
|
2010-12-02 12:17:54 +11:00
|
|
|
flag_t *f;
|
|
|
|
int i;
|
2011-02-16 05:21:33 +11:00
|
|
|
int doredraw = B_FALSE;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// identified things mean all new flags are autmaticlaly known.
|
|
|
|
if (hasflag(fp, F_IDENTIFIED)) {
|
|
|
|
known = B_KNOWN;
|
|
|
|
}
|
|
|
|
|
2011-03-22 18:06:28 +11:00
|
|
|
if ((id == F_POISONED) && isimmuneto(fp, DT_POISON)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// certain flags stack...
|
|
|
|
if (flagstacks(id)) {
|
|
|
|
f = hasflag(fp, id);
|
|
|
|
if (f) {
|
|
|
|
// add values!
|
|
|
|
f->val[0] += val1;
|
|
|
|
f->val[1] += val2;
|
|
|
|
f->val[2] += val3;
|
|
|
|
// TODO: how to handle text??
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-01 10:54:44 +11:00
|
|
|
// override values sometimes
|
|
|
|
/*
|
|
|
|
if ((id == F_WET) && (val2 == NA)) {
|
|
|
|
val2 = WETTIME;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
if (fp->first == NULL) {
|
|
|
|
fp->first = malloc(sizeof(flag_t));
|
|
|
|
f = fp->first;
|
|
|
|
f->prev = NULL;
|
|
|
|
} else {
|
|
|
|
// go to end of list
|
|
|
|
f = fp->last;
|
|
|
|
f->next = malloc(sizeof(flag_t));
|
|
|
|
f->next->prev = f;
|
|
|
|
f = f->next;
|
|
|
|
}
|
|
|
|
fp->last = f;
|
|
|
|
|
|
|
|
f->next = NULL;
|
|
|
|
|
|
|
|
// fill in props
|
2011-02-01 06:16:13 +11:00
|
|
|
f->id = id;
|
|
|
|
f->lifetime = lifetime;
|
|
|
|
f->known = known;
|
2011-02-16 05:21:33 +11:00
|
|
|
f->obfrom = obfromid;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
// first blank values
|
|
|
|
for (i = 0; i < 3; i++) {
|
2010-12-07 18:34:26 +11:00
|
|
|
f->val[i] = NA;
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
f->val[0] = val1;
|
|
|
|
f->nvals = 1;
|
|
|
|
if (val2 != NA) {
|
|
|
|
f->val[1] = val2;
|
|
|
|
f->nvals++;
|
|
|
|
}
|
|
|
|
if (val3 != NA) {
|
2010-12-07 18:34:26 +11:00
|
|
|
f->val[2] = val3;
|
2010-12-02 12:17:54 +11:00
|
|
|
f->nvals++;
|
|
|
|
}
|
|
|
|
if (text) {
|
|
|
|
f->text = strdup(text);
|
|
|
|
} else {
|
|
|
|
f->text = strdup("");
|
|
|
|
}
|
|
|
|
|
|
|
|
f->pile = fp;
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
// notify
|
2011-03-18 12:25:18 +11:00
|
|
|
if ((gamemode == GM_GAMESTARTED)) {
|
2011-02-01 06:16:13 +11:00
|
|
|
if (f->pile->owner) {
|
|
|
|
if (announceflaggain(f->pile->owner, f)) {
|
2011-04-08 13:18:54 +10:00
|
|
|
addflag(f->pile, F_INTERRUPTED, B_TRUE, NA, NA, NULL); // note: recursive call!
|
2011-02-01 06:16:13 +11:00
|
|
|
f->known = B_TRUE;
|
2011-03-16 15:45:46 +11:00
|
|
|
if (f->obfrom) {
|
2011-02-16 05:21:33 +11:00
|
|
|
object_t *ob;
|
|
|
|
|
|
|
|
ob = findobbyid(f->pile->owner->pack, f->obfrom);
|
|
|
|
if (ob) {
|
|
|
|
flag_t *f2;
|
|
|
|
switch (f->lifetime) {
|
|
|
|
case FROMOBEQUIP:
|
|
|
|
f2 = hasflagval(ob->flags, F_EQUIPCONFER, f->id, NA, NA, NULL);
|
|
|
|
break;
|
|
|
|
case FROMOBHOLD:
|
|
|
|
f2 = hasflagval(ob->flags, F_HOLDCONFER, f->id, NA, NA, NULL);
|
|
|
|
break;
|
|
|
|
case FROMOBACTIVATE:
|
|
|
|
f2 = hasflagval(ob->flags, F_ACTIVATECONFER, f->id, NA, NA, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (f2) {
|
|
|
|
f2->known = B_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
2011-03-16 15:45:46 +11:00
|
|
|
// player flags which cause a redraw
|
2011-03-24 16:09:31 +11:00
|
|
|
doredraw = flagcausesredraw(f->pile->owner, f->id);
|
2011-02-01 06:16:13 +11:00
|
|
|
} else if (f->pile->ob) {
|
|
|
|
if (announceobflaggain(f->pile->ob, f)) {
|
|
|
|
f->known = B_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-22 18:06:28 +11:00
|
|
|
// special effects
|
|
|
|
if (f->pile->owner) {
|
* [+] F_prone if you're knocked down
- [+] make sheilds very good against projectiles
- [+] make smoke just REDUCE vision, not block it.
- [+] noncorporeal should stop grabs!
* [+] don't say 'a javelin is damaged' when you throw it, just apply
the damge
- [+] increase damage bonus with every lore level. +10% each time
(ie. up to 50% at top)
* [+] give accuracy + critical bonus for lore levles too
- [+] typo: Enhance which skill enhance (1 left)? ['=next page,?=toggle]
- [+] Show Pain on botl.
* [+] more staves
- [+] low hitpoint warning for pets (or make them shriek, whine, etc)
- [+] CRITKNOCKDOWN
* [+] FINISH GRIZZLY
- [+] undead should be immune to poison!!
- [+] make code to auto add flags to undead.
- [+] if you ever move a door (ie. airblast), automatically open it.
- [+] young wolf shouldn't be able to open a door!
* [+] You throw a dart at the carpet snake. Your dart misses
you.--More--
- [+] no sprinting while burdneed
- [+] blood should be drawn BELOW stairs
- [+] weilded torch should do 1d4 fire damage (counts as a club)
* [+] The skeleton touches a leather belt then recoils in pain!The
skeleton drops a blessed leather belt.The skeleton puts on a
leather belt.
- [+] don't show "you can cast it at power level xxx" for abilities
* [+] more item randomising
- [+] make grey ooze splatter into acid
- [+] "the vine grabs you" if you walk onto an entangling vine.
- [+] don't start monsters within player's los
- [+] properly randomise sticks to snakes
- [+] stirge
- [+] leech (like stirge but can charge/leap, and slightly more hp /
damage)
- [+] treesnake
- [+] constrictor
- [+] cobra
- [+] stickes to snakes - make caster's weapon revert.
- [+] A something comes into view.
- [+] is invisibility code working properly when you see someone use
the invis spell?
- [+] don't include cosmetic objects in 'you see xxx'
* [+] monsters: don't use spells if you don't have lof.
- [+] pets not following around corners if you move diagonally. fixed a
little.
- [+] summon small animals (2-3 x SZ_SMALL)
* [+] jet of water
- [+] summon medium animals (2-4 x SZ_MEDIUM, wolf etc)
- [+] lightning storm (lightbning everyone within los, and more damage)
- [+] summon large animals (SZ_LARGE, horse, bear etc)
2011-05-03 17:34:07 +10:00
|
|
|
float pct;
|
2011-03-22 18:06:28 +11:00
|
|
|
switch (f->id) {
|
|
|
|
case F_ASLEEP:
|
|
|
|
stopallspells(f->pile->owner);
|
|
|
|
break;
|
|
|
|
case F_NONCORPOREAL:
|
|
|
|
killflagsofid(f->pile->owner->flags, F_BEINGSTONED);
|
|
|
|
break;
|
* [+] F_prone if you're knocked down
- [+] make sheilds very good against projectiles
- [+] make smoke just REDUCE vision, not block it.
- [+] noncorporeal should stop grabs!
* [+] don't say 'a javelin is damaged' when you throw it, just apply
the damge
- [+] increase damage bonus with every lore level. +10% each time
(ie. up to 50% at top)
* [+] give accuracy + critical bonus for lore levles too
- [+] typo: Enhance which skill enhance (1 left)? ['=next page,?=toggle]
- [+] Show Pain on botl.
* [+] more staves
- [+] low hitpoint warning for pets (or make them shriek, whine, etc)
- [+] CRITKNOCKDOWN
* [+] FINISH GRIZZLY
- [+] undead should be immune to poison!!
- [+] make code to auto add flags to undead.
- [+] if you ever move a door (ie. airblast), automatically open it.
- [+] young wolf shouldn't be able to open a door!
* [+] You throw a dart at the carpet snake. Your dart misses
you.--More--
- [+] no sprinting while burdneed
- [+] blood should be drawn BELOW stairs
- [+] weilded torch should do 1d4 fire damage (counts as a club)
* [+] The skeleton touches a leather belt then recoils in pain!The
skeleton drops a blessed leather belt.The skeleton puts on a
leather belt.
- [+] don't show "you can cast it at power level xxx" for abilities
* [+] more item randomising
- [+] make grey ooze splatter into acid
- [+] "the vine grabs you" if you walk onto an entangling vine.
- [+] don't start monsters within player's los
- [+] properly randomise sticks to snakes
- [+] stirge
- [+] leech (like stirge but can charge/leap, and slightly more hp /
damage)
- [+] treesnake
- [+] constrictor
- [+] cobra
- [+] stickes to snakes - make caster's weapon revert.
- [+] A something comes into view.
- [+] is invisibility code working properly when you see someone use
the invis spell?
- [+] don't include cosmetic objects in 'you see xxx'
* [+] monsters: don't use spells if you don't have lof.
- [+] pets not following around corners if you move diagonally. fixed a
little.
- [+] summon small animals (2-3 x SZ_SMALL)
* [+] jet of water
- [+] summon medium animals (2-4 x SZ_MEDIUM, wolf etc)
- [+] lightning storm (lightbning everyone within los, and more damage)
- [+] summon large animals (SZ_LARGE, horse, bear etc)
2011-05-03 17:34:07 +10:00
|
|
|
case F_RAGE:
|
|
|
|
f->val[0] = f->pile->owner->hp; // remember old maxhp
|
|
|
|
f->val[1] = f->pile->owner->maxhp; // remember old maxhp
|
|
|
|
pct = (float)f->pile->owner->hp / (float)f->pile->owner->maxhp;
|
|
|
|
f->pile->owner->maxhp = (float)f->pile->owner->maxhp * 1.5;
|
|
|
|
f->pile->owner->hp = pct * (float)f->pile->owner->maxhp;
|
|
|
|
break;
|
2011-03-22 18:06:28 +11:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-18 12:25:18 +11:00
|
|
|
if ((gamemode == GM_GAMESTARTED) && doredraw) {
|
2011-02-16 05:21:33 +11:00
|
|
|
statdirty = B_TRUE;
|
|
|
|
needredraw = B_TRUE;
|
|
|
|
drawscreen();
|
|
|
|
}
|
2010-12-02 12:17:54 +11:00
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
flagpile_t *addflagpile(lifeform_t *owner, object_t *ob) {
|
2010-12-02 12:17:54 +11:00
|
|
|
flagpile_t *fp;
|
|
|
|
fp = malloc(sizeof(flagpile_t));
|
|
|
|
fp->first = NULL;
|
|
|
|
fp->last = NULL;
|
2011-02-01 06:16:13 +11:00
|
|
|
fp->owner = owner;
|
|
|
|
fp->ob = ob;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
return fp;
|
|
|
|
}
|
|
|
|
|
2011-04-01 10:54:44 +11:00
|
|
|
void copyflag(flagpile_t *dst, flagpile_t *src, enum FLAG id) {
|
|
|
|
flag_t *f;
|
|
|
|
for (f = src->first ; f ; f = f->next) {
|
|
|
|
if (f->id == id) {
|
|
|
|
addflag_real(dst, f->id, f->val[0], f->val[1], f->val[2], f->text,
|
|
|
|
f->lifetime, f->known, -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
void copyflags(flagpile_t *dst, flagpile_t *src, int lifetime) {
|
|
|
|
flag_t *f;
|
|
|
|
for (f = src->first ; f ; f = f->next) {
|
|
|
|
addflag_real(dst, f->id, f->val[0], f->val[1], f->val[2], f->text,
|
2011-02-16 05:21:33 +11:00
|
|
|
(lifetime == NA) ? f->lifetime : lifetime, f->known, -1);
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-24 16:09:31 +11:00
|
|
|
int flagcausesredraw(lifeform_t *lf, enum FLAG fid) {
|
|
|
|
if (!lf) return B_FALSE;
|
|
|
|
|
|
|
|
if (isplayer(lf)) {
|
|
|
|
// player
|
|
|
|
switch (fid) {
|
|
|
|
case F_BLIND:
|
|
|
|
case F_DETECTLIFE:
|
|
|
|
case F_DETECTOBS:
|
|
|
|
case F_FASTMOVE:
|
2011-04-14 09:44:29 +10:00
|
|
|
case F_HIDING:
|
2011-03-24 16:09:31 +11:00
|
|
|
case F_INVISIBLE:
|
* [+] F_prone if you're knocked down
- [+] make sheilds very good against projectiles
- [+] make smoke just REDUCE vision, not block it.
- [+] noncorporeal should stop grabs!
* [+] don't say 'a javelin is damaged' when you throw it, just apply
the damge
- [+] increase damage bonus with every lore level. +10% each time
(ie. up to 50% at top)
* [+] give accuracy + critical bonus for lore levles too
- [+] typo: Enhance which skill enhance (1 left)? ['=next page,?=toggle]
- [+] Show Pain on botl.
* [+] more staves
- [+] low hitpoint warning for pets (or make them shriek, whine, etc)
- [+] CRITKNOCKDOWN
* [+] FINISH GRIZZLY
- [+] undead should be immune to poison!!
- [+] make code to auto add flags to undead.
- [+] if you ever move a door (ie. airblast), automatically open it.
- [+] young wolf shouldn't be able to open a door!
* [+] You throw a dart at the carpet snake. Your dart misses
you.--More--
- [+] no sprinting while burdneed
- [+] blood should be drawn BELOW stairs
- [+] weilded torch should do 1d4 fire damage (counts as a club)
* [+] The skeleton touches a leather belt then recoils in pain!The
skeleton drops a blessed leather belt.The skeleton puts on a
leather belt.
- [+] don't show "you can cast it at power level xxx" for abilities
* [+] more item randomising
- [+] make grey ooze splatter into acid
- [+] "the vine grabs you" if you walk onto an entangling vine.
- [+] don't start monsters within player's los
- [+] properly randomise sticks to snakes
- [+] stirge
- [+] leech (like stirge but can charge/leap, and slightly more hp /
damage)
- [+] treesnake
- [+] constrictor
- [+] cobra
- [+] stickes to snakes - make caster's weapon revert.
- [+] A something comes into view.
- [+] is invisibility code working properly when you see someone use
the invis spell?
- [+] don't include cosmetic objects in 'you see xxx'
* [+] monsters: don't use spells if you don't have lof.
- [+] pets not following around corners if you move diagonally. fixed a
little.
- [+] summon small animals (2-3 x SZ_SMALL)
* [+] jet of water
- [+] summon medium animals (2-4 x SZ_MEDIUM, wolf etc)
- [+] lightning storm (lightbning everyone within los, and more damage)
- [+] summon large animals (SZ_LARGE, horse, bear etc)
2011-05-03 17:34:07 +10:00
|
|
|
case F_RAGE:
|
2011-03-24 16:09:31 +11:00
|
|
|
case F_SEEINDARK:
|
|
|
|
case F_SEEINVIS:
|
|
|
|
case F_SPRINTING:
|
|
|
|
case F_SLOWMOVE:
|
|
|
|
case F_TIRED:
|
|
|
|
return B_TRUE;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else if (haslos(player, lf->cell)) {
|
|
|
|
switch (fid) {
|
|
|
|
case F_INVISIBLE:
|
|
|
|
return B_TRUE;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// nonplayer
|
|
|
|
}
|
|
|
|
return B_FALSE;
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
int flagstacks(enum FLAG fid) {
|
|
|
|
int res = B_FALSE;
|
|
|
|
switch (fid) {
|
|
|
|
case F_EVASION:
|
|
|
|
res = B_TRUE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
res = B_FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
flag_t *hasflag(flagpile_t *fp, int id) {
|
2011-03-22 18:06:28 +11:00
|
|
|
return hasflag_real(fp, id, NA, NULL);
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
flag_t *hasflagknown(flagpile_t *fp, int id) {
|
2011-03-22 18:06:28 +11:00
|
|
|
return hasflag_real(fp, id, B_TRUE, NULL);
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
|
2011-03-22 18:06:28 +11:00
|
|
|
flag_t *hasflag_real(flagpile_t *fp, int id, int wantknown, flag_t *exception) {
|
2010-12-02 12:17:54 +11:00
|
|
|
flag_t *f;
|
2011-02-01 06:16:13 +11:00
|
|
|
lifeform_t *owner;
|
|
|
|
owner = fp->owner;
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
for (f = fp->first ; f ; f = f->next) {
|
2011-03-22 18:06:28 +11:00
|
|
|
if ((f->id == id) && (f != exception)) {
|
2011-02-01 06:16:13 +11:00
|
|
|
int valid = B_TRUE;
|
|
|
|
if ((wantknown != NA) && (f->known != wantknown)) valid = B_FALSE;
|
|
|
|
if (owner && (f->lifetime == FROMJOB) && !getjob(owner)) {
|
|
|
|
valid = B_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
}
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
flag_t *hasflagval(flagpile_t *fp, int id, int val1, int val2, int val3, char *text) {
|
2011-02-01 06:16:13 +11:00
|
|
|
return hasflagval_real(fp, id, val1, val2, val3, text, B_FALSE); // doesn't have to be known
|
|
|
|
}
|
|
|
|
|
|
|
|
flag_t *hasflagvalknown(flagpile_t *fp, int id, int val1, int val2, int val3, char *text) {
|
|
|
|
return hasflagval_real(fp, id, val1, val2, val3, text, B_TRUE); // must be known
|
|
|
|
}
|
|
|
|
|
* [+] F_prone if you're knocked down
- [+] make sheilds very good against projectiles
- [+] make smoke just REDUCE vision, not block it.
- [+] noncorporeal should stop grabs!
* [+] don't say 'a javelin is damaged' when you throw it, just apply
the damge
- [+] increase damage bonus with every lore level. +10% each time
(ie. up to 50% at top)
* [+] give accuracy + critical bonus for lore levles too
- [+] typo: Enhance which skill enhance (1 left)? ['=next page,?=toggle]
- [+] Show Pain on botl.
* [+] more staves
- [+] low hitpoint warning for pets (or make them shriek, whine, etc)
- [+] CRITKNOCKDOWN
* [+] FINISH GRIZZLY
- [+] undead should be immune to poison!!
- [+] make code to auto add flags to undead.
- [+] if you ever move a door (ie. airblast), automatically open it.
- [+] young wolf shouldn't be able to open a door!
* [+] You throw a dart at the carpet snake. Your dart misses
you.--More--
- [+] no sprinting while burdneed
- [+] blood should be drawn BELOW stairs
- [+] weilded torch should do 1d4 fire damage (counts as a club)
* [+] The skeleton touches a leather belt then recoils in pain!The
skeleton drops a blessed leather belt.The skeleton puts on a
leather belt.
- [+] don't show "you can cast it at power level xxx" for abilities
* [+] more item randomising
- [+] make grey ooze splatter into acid
- [+] "the vine grabs you" if you walk onto an entangling vine.
- [+] don't start monsters within player's los
- [+] properly randomise sticks to snakes
- [+] stirge
- [+] leech (like stirge but can charge/leap, and slightly more hp /
damage)
- [+] treesnake
- [+] constrictor
- [+] cobra
- [+] stickes to snakes - make caster's weapon revert.
- [+] A something comes into view.
- [+] is invisibility code working properly when you see someone use
the invis spell?
- [+] don't include cosmetic objects in 'you see xxx'
* [+] monsters: don't use spells if you don't have lof.
- [+] pets not following around corners if you move diagonally. fixed a
little.
- [+] summon small animals (2-3 x SZ_SMALL)
* [+] jet of water
- [+] summon medium animals (2-4 x SZ_MEDIUM, wolf etc)
- [+] lightning storm (lightbning everyone within los, and more damage)
- [+] summon large animals (SZ_LARGE, horse, bear etc)
2011-05-03 17:34:07 +10:00
|
|
|
int getcounter(flagpile_t *fp) {
|
|
|
|
flag_t *f;
|
|
|
|
f = hasflag(fp, F_COUNTER);
|
|
|
|
if (f) {
|
|
|
|
return f->val[0];
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
flag_t *hasflagval_real(flagpile_t *fp, int id, int val1, int val2, int val3, char *text, int wantknown) {
|
2010-12-02 12:17:54 +11:00
|
|
|
flag_t *f;
|
2011-02-01 06:16:13 +11:00
|
|
|
lifeform_t *owner;
|
|
|
|
owner = fp->owner;
|
2010-12-02 12:17:54 +11:00
|
|
|
for (f = fp->first ; f ; f = f->next) {
|
|
|
|
if (f->id == id) {
|
2011-02-01 06:16:13 +11:00
|
|
|
if (owner && (f->lifetime == FROMJOB) && !getjob(owner)) {
|
|
|
|
// invalid
|
|
|
|
} else {
|
|
|
|
if ( ((val1 == NA) || (f->val[0] == val1)) &&
|
|
|
|
((val2 == NA) || (f->val[1] == val2)) &&
|
|
|
|
((val3 == NA) || (f->val[2] == val3)) &&
|
|
|
|
((text == NULL) || strstr(f->text, text))) {
|
|
|
|
if (!wantknown || f->known) {
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
}
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-03-04 12:22:36 +11:00
|
|
|
// returns true if we did something
|
|
|
|
int killflagsofid(flagpile_t *fp, enum FLAG fid) {
|
2011-02-01 06:16:13 +11:00
|
|
|
flag_t *f,*nextf;
|
2011-03-04 12:22:36 +11:00
|
|
|
int donesomething = B_FALSE;
|
2011-02-01 06:16:13 +11:00
|
|
|
for (f = fp->first ; f ; f = nextf) {
|
|
|
|
nextf = f->next;
|
|
|
|
if (f->id == fid) {
|
|
|
|
killflag(f);
|
2011-03-04 12:22:36 +11:00
|
|
|
donesomething = B_TRUE;
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
}
|
2011-03-04 12:22:36 +11:00
|
|
|
return donesomething;
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
void killflag(flag_t *f) {
|
|
|
|
flag_t *nextone, *lastone;
|
2011-02-01 06:16:13 +11:00
|
|
|
lifeform_t *lf;
|
2011-02-16 05:21:33 +11:00
|
|
|
int doredraw = B_FALSE;
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
lf = f->pile->owner;
|
|
|
|
|
2011-03-24 16:09:31 +11:00
|
|
|
// flags which cause a redraw
|
|
|
|
doredraw = flagcausesredraw(f->pile->owner, f->id);
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
// notify
|
2011-03-18 12:25:18 +11:00
|
|
|
if ((gamemode == GM_GAMESTARTED)) {
|
2011-04-08 13:18:54 +10:00
|
|
|
if (lf) {
|
|
|
|
// special cases
|
|
|
|
if (f->id == F_FLEEFROM) {
|
|
|
|
// once you recover from fleeing from something,
|
|
|
|
// you don't find it scary for a little while.
|
|
|
|
if (!lfhasflagval(lf, F_NOFLEEFROM, f->val[0], NA, NA, NULL)) {
|
|
|
|
addtempflag(lf->flags, F_NOFLEEFROM, f->val[0], NA, NA, NULL, 10);
|
|
|
|
}
|
* [+] F_prone if you're knocked down
- [+] make sheilds very good against projectiles
- [+] make smoke just REDUCE vision, not block it.
- [+] noncorporeal should stop grabs!
* [+] don't say 'a javelin is damaged' when you throw it, just apply
the damge
- [+] increase damage bonus with every lore level. +10% each time
(ie. up to 50% at top)
* [+] give accuracy + critical bonus for lore levles too
- [+] typo: Enhance which skill enhance (1 left)? ['=next page,?=toggle]
- [+] Show Pain on botl.
* [+] more staves
- [+] low hitpoint warning for pets (or make them shriek, whine, etc)
- [+] CRITKNOCKDOWN
* [+] FINISH GRIZZLY
- [+] undead should be immune to poison!!
- [+] make code to auto add flags to undead.
- [+] if you ever move a door (ie. airblast), automatically open it.
- [+] young wolf shouldn't be able to open a door!
* [+] You throw a dart at the carpet snake. Your dart misses
you.--More--
- [+] no sprinting while burdneed
- [+] blood should be drawn BELOW stairs
- [+] weilded torch should do 1d4 fire damage (counts as a club)
* [+] The skeleton touches a leather belt then recoils in pain!The
skeleton drops a blessed leather belt.The skeleton puts on a
leather belt.
- [+] don't show "you can cast it at power level xxx" for abilities
* [+] more item randomising
- [+] make grey ooze splatter into acid
- [+] "the vine grabs you" if you walk onto an entangling vine.
- [+] don't start monsters within player's los
- [+] properly randomise sticks to snakes
- [+] stirge
- [+] leech (like stirge but can charge/leap, and slightly more hp /
damage)
- [+] treesnake
- [+] constrictor
- [+] cobra
- [+] stickes to snakes - make caster's weapon revert.
- [+] A something comes into view.
- [+] is invisibility code working properly when you see someone use
the invis spell?
- [+] don't include cosmetic objects in 'you see xxx'
* [+] monsters: don't use spells if you don't have lof.
- [+] pets not following around corners if you move diagonally. fixed a
little.
- [+] summon small animals (2-3 x SZ_SMALL)
* [+] jet of water
- [+] summon medium animals (2-4 x SZ_MEDIUM, wolf etc)
- [+] lightning storm (lightbning everyone within los, and more damage)
- [+] summon large animals (SZ_LARGE, horse, bear etc)
2011-05-03 17:34:07 +10:00
|
|
|
} else if (f->id == F_RAGE) {
|
|
|
|
if (!isdead(lf)) {
|
|
|
|
// restore original maxhp
|
|
|
|
float pct;
|
|
|
|
pct = (float)lf->hp / (float)lf->maxhp;
|
|
|
|
lf->maxhp = f->val[1];
|
|
|
|
lf->hp = pct * (float)lf->maxhp;
|
|
|
|
if (lf->hp < 1) lf->hp = 1;
|
|
|
|
}
|
2011-04-08 13:18:54 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
// announce
|
|
|
|
if (announceflagloss(lf, f)) {
|
2011-03-25 12:23:15 +11:00
|
|
|
// don't include flags which interrupt will kill!
|
|
|
|
switch (f->id) {
|
|
|
|
case F_RESTING:
|
|
|
|
case F_RUNNING:
|
|
|
|
case F_AUTOCMD:
|
|
|
|
break;
|
|
|
|
default:
|
2011-04-08 13:18:54 +10:00
|
|
|
addflag(lf->flags, F_INTERRUPTED, B_TRUE, NA, NA, NULL);
|
2011-03-25 12:23:15 +11:00
|
|
|
break;
|
|
|
|
}
|
2011-03-04 12:22:36 +11:00
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
} else if (f->pile->ob) {
|
|
|
|
announceobflagloss(f->pile->ob, f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// we will revert to our original form at the end of timeeffectslf().
|
|
|
|
if (lf && (f->id == F_POLYMORPHED)) {
|
2011-04-06 17:27:55 +10:00
|
|
|
if (lfhasflag(lf, F_ORIGRACE)) {
|
|
|
|
lf->polyrevert = B_TRUE;
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
// free mem
|
|
|
|
|
|
|
|
// remove from list
|
|
|
|
nextone = f->next;
|
|
|
|
if (nextone != NULL) {
|
|
|
|
nextone->prev = f->prev;
|
|
|
|
} else { /* last */
|
|
|
|
f->pile->last = f->prev;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (f->prev == NULL) {
|
|
|
|
/* first */
|
|
|
|
nextone = f->next;
|
|
|
|
f->pile->first = nextone;
|
|
|
|
free(f);
|
|
|
|
} else {
|
|
|
|
lastone = f->prev;
|
|
|
|
free (lastone->next );
|
|
|
|
lastone->next = nextone;
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
|
2011-03-18 12:25:18 +11:00
|
|
|
if ((gamemode == GM_GAMESTARTED) && doredraw) {
|
2011-02-16 05:21:33 +11:00
|
|
|
statdirty = B_TRUE;
|
|
|
|
needredraw = B_TRUE;
|
2011-02-01 06:16:13 +11:00
|
|
|
drawscreen();
|
|
|
|
}
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
void killflagpile(flagpile_t *fp) {
|
|
|
|
while (fp->first) {
|
|
|
|
killflag(fp->first);
|
|
|
|
}
|
|
|
|
free(fp);
|
|
|
|
}
|
|
|
|
|
2011-03-24 16:09:31 +11:00
|
|
|
void timeeffectsflag(flag_t *f, int howlong) {
|
2011-02-01 06:16:13 +11:00
|
|
|
if ((f->lifetime != PERMENANT) && (f->lifetime > 0)) {
|
* [+] bug: secret doors revealed when we walk away from them.
- [+] make lamps last heaps longer
* [+] web spell
* [+] spider monstrer
* [+] funnelweb:
* [+] redback:
- [+] if you are wracked with pain, don't clear msg
- [+] check rarity for spiders
* [+] attack/defense mod if there is stickiness in your square
- [+] replace "sticky" with "restrictive"
* [+] make some mosnters start hidden
- [+] adjust spot checks basd on distance
- [+] ensure that attacking stops you hiding
- [+] casting spells stops you from being hidden
- [+] hidden mosnters shouldn't move unless their victim is ADJACENT.
- [+] hidden mosnters shouldn't cast spells, throw missiles, etc unless
their victim is ADJACENT.
- [-] XP CALC
- [+] funnelweb and redback are the same.
- [+] check this is right...... i want funnel web to be worse.
- [+] make hitconfer check in calcxpval take lifetime into account
- [+] ALSO assign an xp rating to each hitconferred flag.
- [+] hardcode this.
* [+] entangle spell
- [+] reveal secret doors if you see them get damaged.
* [+] make askcoords list restrivitce objects
- [+] ACTUALLY make vines not damaged by struggling
* [+] object descriptions, a/an needs to change if showing condition:
"a battered entangling vine"
- [+] wizard levelled up and was prompted for "WISH, GIFT"! shouldn't
happen!
- [+] The human diety reads a blessed scroll of create monster! -- but
nothing happens??
* [+] throw code
- [+] wizard: ask for school specialty at start, from: fire, ice, xxx
? You get this + WILD.
- [+] describe varpower spells
- [+] fix mp cost for varpower spells
- [+] we're not stopping running at staircases anymore for some reason.
- [+] CHARGE ability (like swoop but don't return to original positino)
- [+] need to honor f_canlearn when displaying new skills to learn!
- [+] ai: if we are going to player's last known loc (via targetcell),
abandon if we can SEE the player!
- [+] make shatter() into a function
- [+] oil potion makes oil puddle whan smashed
- [+] make flammable objects be able to convert to others
- [+] replace 'magic item usage' with 'channeling'
- [+] a cloud of darkness descends. this is a *cursed* wand of light.
- [+] spiders shouldn't be able to be stuck in a web!
* [+] spells should be able to have MULTIPLE schools.
- [+] don't bleed into walls
- [+] in @M, use colours to show which spells are too hard so far (ie
cost > maxmp)
* [+] in @M, use schools that you know
* [+] after loading game, barbarian is getting an extra attack?
You miss the eyebat. You punch the eyebat.
- [+] show objects on top of stairs
- [+] stuck mosnters must pass a saving throw to follow you up/down
stairs
- [+] genericise: trytomove(lf)
* [+] add more snakes
- [+] undead can't eat or drink? or MOST undead can't.
* [+] why can MONSTERS shoot webs through things? (but I can't)
- [+] barkskin - doesn't reduce max mp enough?
- [+] The skeleton touches a fuming aqua potion [tried] then recoils in
pain!
The skeleton drops a blessed fuming aqua potion [tried].
The skeleton drinks a fuming aqua potion!
- [+] why can't i use abilites anymore?
- [+] infinite loop bug due to ai only having one ignorecell.
- [+] make sleet storms rust all armour
- [+] make a kind of walkdam that hits armour
- [+] add this as well as walkdam for: acid, fire, water
- [+] Takeoff isn't prompting properly. only showing weapons!
* [+] waterproof obs (ie cloak)
* [+] walkdambp doesn't hurt body if you have a cloak
NATURE SPELLS:
- [+] mending, heals 1d6 damage
- [+] spark
- [+] purify food
- [+] sticks to snakes
- [+] calm animals (power_d4 hd)
* [+] charm animal (works on one animal up to power hit dice, temporary)
- [+] airblast
- [+] barkskin (power +2 AR, firevuln, ongoing)
- [+] soften earth (makes ground into mud)
- [+] warp wood (damages wooden objects)
- [+] repel insects
- [+] reduce poison
- [+] web
- [+] windshield
- [+] call lightning, air
- [+] resist elements, ongoing
- [+] passwall
- [+] poisonbolt
- [+] quench (puts out a fire)
- [+] sleet storm (lowers movement, vision)
- [+] healing
- [+] cure poison
* [+] calming scent
- [+] dig
- [+] entangle
- [+] levitate
- [+] flamepillar
- [+] hailstorm. like sleetstorm but hurts more. power d 6.
- [+] burning wave
- [+] gaseous form
* [+] knowledge skills:
* [+] force makespellchoicelist() to show spells in level order.
* [+] druid
- [+] check OBJECT rarity list (dumplev)
- [+] fix bug where heaps of books suddently appear from dlev 3 onwards
- [+] gain skills on level up for some jobs
- [+] f_levspellschool, v0=lev, v1 = school or ANY - select one
from that school
2011-04-23 14:27:42 +10:00
|
|
|
// special case - fast metabolism speeds up poison too.
|
|
|
|
if (f->id == F_POISONED) {
|
|
|
|
int multiplier;
|
|
|
|
sumflags(f->pile, F_FASTMETAB, &multiplier, NULL, NULL);
|
|
|
|
if (multiplier > 0) {
|
|
|
|
howlong *= multiplier;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-24 16:09:31 +11:00
|
|
|
f->lifetime -= howlong;
|
* [+] bug: secret doors revealed when we walk away from them.
- [+] make lamps last heaps longer
* [+] web spell
* [+] spider monstrer
* [+] funnelweb:
* [+] redback:
- [+] if you are wracked with pain, don't clear msg
- [+] check rarity for spiders
* [+] attack/defense mod if there is stickiness in your square
- [+] replace "sticky" with "restrictive"
* [+] make some mosnters start hidden
- [+] adjust spot checks basd on distance
- [+] ensure that attacking stops you hiding
- [+] casting spells stops you from being hidden
- [+] hidden mosnters shouldn't move unless their victim is ADJACENT.
- [+] hidden mosnters shouldn't cast spells, throw missiles, etc unless
their victim is ADJACENT.
- [-] XP CALC
- [+] funnelweb and redback are the same.
- [+] check this is right...... i want funnel web to be worse.
- [+] make hitconfer check in calcxpval take lifetime into account
- [+] ALSO assign an xp rating to each hitconferred flag.
- [+] hardcode this.
* [+] entangle spell
- [+] reveal secret doors if you see them get damaged.
* [+] make askcoords list restrivitce objects
- [+] ACTUALLY make vines not damaged by struggling
* [+] object descriptions, a/an needs to change if showing condition:
"a battered entangling vine"
- [+] wizard levelled up and was prompted for "WISH, GIFT"! shouldn't
happen!
- [+] The human diety reads a blessed scroll of create monster! -- but
nothing happens??
* [+] throw code
- [+] wizard: ask for school specialty at start, from: fire, ice, xxx
? You get this + WILD.
- [+] describe varpower spells
- [+] fix mp cost for varpower spells
- [+] we're not stopping running at staircases anymore for some reason.
- [+] CHARGE ability (like swoop but don't return to original positino)
- [+] need to honor f_canlearn when displaying new skills to learn!
- [+] ai: if we are going to player's last known loc (via targetcell),
abandon if we can SEE the player!
- [+] make shatter() into a function
- [+] oil potion makes oil puddle whan smashed
- [+] make flammable objects be able to convert to others
- [+] replace 'magic item usage' with 'channeling'
- [+] a cloud of darkness descends. this is a *cursed* wand of light.
- [+] spiders shouldn't be able to be stuck in a web!
* [+] spells should be able to have MULTIPLE schools.
- [+] don't bleed into walls
- [+] in @M, use colours to show which spells are too hard so far (ie
cost > maxmp)
* [+] in @M, use schools that you know
* [+] after loading game, barbarian is getting an extra attack?
You miss the eyebat. You punch the eyebat.
- [+] show objects on top of stairs
- [+] stuck mosnters must pass a saving throw to follow you up/down
stairs
- [+] genericise: trytomove(lf)
* [+] add more snakes
- [+] undead can't eat or drink? or MOST undead can't.
* [+] why can MONSTERS shoot webs through things? (but I can't)
- [+] barkskin - doesn't reduce max mp enough?
- [+] The skeleton touches a fuming aqua potion [tried] then recoils in
pain!
The skeleton drops a blessed fuming aqua potion [tried].
The skeleton drinks a fuming aqua potion!
- [+] why can't i use abilites anymore?
- [+] infinite loop bug due to ai only having one ignorecell.
- [+] make sleet storms rust all armour
- [+] make a kind of walkdam that hits armour
- [+] add this as well as walkdam for: acid, fire, water
- [+] Takeoff isn't prompting properly. only showing weapons!
* [+] waterproof obs (ie cloak)
* [+] walkdambp doesn't hurt body if you have a cloak
NATURE SPELLS:
- [+] mending, heals 1d6 damage
- [+] spark
- [+] purify food
- [+] sticks to snakes
- [+] calm animals (power_d4 hd)
* [+] charm animal (works on one animal up to power hit dice, temporary)
- [+] airblast
- [+] barkskin (power +2 AR, firevuln, ongoing)
- [+] soften earth (makes ground into mud)
- [+] warp wood (damages wooden objects)
- [+] repel insects
- [+] reduce poison
- [+] web
- [+] windshield
- [+] call lightning, air
- [+] resist elements, ongoing
- [+] passwall
- [+] poisonbolt
- [+] quench (puts out a fire)
- [+] sleet storm (lowers movement, vision)
- [+] healing
- [+] cure poison
* [+] calming scent
- [+] dig
- [+] entangle
- [+] levitate
- [+] flamepillar
- [+] hailstorm. like sleetstorm but hurts more. power d 6.
- [+] burning wave
- [+] gaseous form
* [+] knowledge skills:
* [+] force makespellchoicelist() to show spells in level order.
* [+] druid
- [+] check OBJECT rarity list (dumplev)
- [+] fix bug where heaps of books suddently appear from dlev 3 onwards
- [+] gain skills on level up for some jobs
- [+] f_levspellschool, v0=lev, v1 = school or ANY - select one
from that school
2011-04-23 14:27:42 +10:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
if (f->lifetime <= 0) {
|
|
|
|
killflag(f);
|
|
|
|
return;
|
|
|
|
} else if (f->lifetime == 5) {
|
|
|
|
// warn about certain flags......
|
|
|
|
if (isplayer(f->pile->owner)) {
|
|
|
|
switch (f->id) {
|
|
|
|
case F_CANWILL:
|
|
|
|
switch (f->val[0]) {
|
|
|
|
case OT_A_JUMP:
|
|
|
|
warn("Your ability to jump is starting to run out...");;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case F_DTIMMUNE:
|
|
|
|
warn("Your %s immunity is starting to run out...", getdamname(f->val[0]));
|
|
|
|
break;
|
|
|
|
case F_DTRESIST:
|
|
|
|
warn("Your %s resistance is starting to run out...", getdamname(f->val[0]));
|
|
|
|
break;
|
|
|
|
case F_DTVULN:
|
|
|
|
warn("You feel a little less vulnerable to %s...", getdamname(f->val[0]));
|
|
|
|
break;
|
|
|
|
case F_MAGSHIELD:
|
|
|
|
warn("Your magnetic shield is weakening...");
|
|
|
|
break;
|
|
|
|
case F_POLYMORPHED:
|
|
|
|
warn("You are starting to revert to your original form...");
|
|
|
|
break;
|
|
|
|
default: // no message
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2011-04-11 15:05:45 +10:00
|
|
|
} else if (f->lifetime == 3) {
|
2011-04-01 10:54:44 +11:00
|
|
|
if (isplayer(f->pile->owner)) {
|
|
|
|
switch (f->id) {
|
|
|
|
case F_SPRINTING:
|
|
|
|
if (f->val[0]) {
|
|
|
|
warn("You will have to stop sprinting soon...");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2011-02-16 05:21:33 +11:00
|
|
|
} else if (f->lifetime == 2) {
|
|
|
|
if (isplayer(f->pile->owner)) {
|
|
|
|
switch (f->id) {
|
|
|
|
case F_NONCORPOREAL:
|
|
|
|
warn("You feel your body solidifying...");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
} else if (f->lifetime == 1) {
|
|
|
|
// warn about certain flags......
|
|
|
|
if (isplayer(f->pile->owner)) {
|
|
|
|
switch (f->id) {
|
|
|
|
case F_CANWILL:
|
|
|
|
switch (f->val[0]) {
|
|
|
|
case OT_A_JUMP:
|
|
|
|
warn("Your ability to jump is about to expire!");;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case F_DTIMMUNE:
|
|
|
|
warn("Your %s immunity is about to expire!", getdamname(f->val[0]));
|
|
|
|
break;
|
|
|
|
case F_DTRESIST:
|
|
|
|
warn("Your %s resistance is about to expire!", getdamname(f->val[0]));
|
|
|
|
break;
|
|
|
|
case F_DTVULN:
|
|
|
|
warn("You feel a little less vulnerable to %s...", getdamname(f->val[0]));
|
|
|
|
break;
|
|
|
|
case F_MAGSHIELD:
|
|
|
|
warn("Your magnetic shield is about to expire!");
|
|
|
|
break;
|
|
|
|
case F_POLYMORPHED:
|
|
|
|
warn("You are about to revert to your original form!");
|
|
|
|
break;
|
|
|
|
default: // no message
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2011-04-01 10:54:44 +11:00
|
|
|
// sprinting is special
|
|
|
|
if (f->id == F_SPRINTING) {
|
|
|
|
if (f->val[0]) {
|
|
|
|
enum SKILLLEVEL slev;
|
|
|
|
lifeform_t *who;
|
|
|
|
int tiredtime;
|
|
|
|
who = f->pile->owner;
|
|
|
|
// now you get slow
|
|
|
|
// you get tired when you finish sprinting
|
|
|
|
tiredtime = 15;
|
|
|
|
|
|
|
|
// adjust for athletics skill. -2 per level.
|
|
|
|
slev = getskill(who, SK_ATHLETICS);
|
|
|
|
if (slev != PR_INEPT) {
|
|
|
|
tiredtime -= (2*slev);
|
|
|
|
}
|
|
|
|
// adjust for constitution
|
|
|
|
tiredtime = tiredtime - (int) ((float)tiredtime * (getstatmod(who, A_CON) / 100) );
|
|
|
|
// enforce minimum
|
|
|
|
if (tiredtime < 1) tiredtime = 1;
|
|
|
|
f->val[0] = B_FALSE;
|
|
|
|
f->lifetime = tiredtime;
|
|
|
|
|
|
|
|
if (isplayer(who)) {
|
|
|
|
msg("You are exhausted.");
|
|
|
|
} else if (cansee(player, who)) {
|
|
|
|
char lfname[BUFLEN];
|
|
|
|
getlfname(who, lfname);
|
|
|
|
msg("%s looks exhausted.",lfname);
|
|
|
|
}
|
2011-04-11 15:05:45 +10:00
|
|
|
needredraw = B_TRUE;
|
|
|
|
statdirty = B_TRUE;
|
2011-04-01 10:54:44 +11:00
|
|
|
}
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
}
|
2011-03-22 18:06:28 +11:00
|
|
|
|
|
|
|
if (f->id == F_BEINGSTONED) {
|
|
|
|
f->val[0]--;
|
|
|
|
if (f->val[0] == 0) {
|
|
|
|
if (!stone(f->pile->owner)) {
|
|
|
|
// lf turned to stone!
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
// stoning failed. stop being stoned.
|
|
|
|
killflag(f);
|
2011-04-01 10:54:44 +11:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (f->id == F_WET) {
|
|
|
|
f->val[1]--;
|
|
|
|
if (f->val[1] <= 0) {
|
|
|
|
f->val[0]--;
|
|
|
|
if (f->val[0] <= W_DRY) {
|
|
|
|
killflag(f);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
// reset timer
|
|
|
|
f->val[1] = WETTIME;
|
|
|
|
// TODO: announce
|
2011-03-22 18:06:28 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
|
* [+] F_prone if you're knocked down
- [+] make sheilds very good against projectiles
- [+] make smoke just REDUCE vision, not block it.
- [+] noncorporeal should stop grabs!
* [+] don't say 'a javelin is damaged' when you throw it, just apply
the damge
- [+] increase damage bonus with every lore level. +10% each time
(ie. up to 50% at top)
* [+] give accuracy + critical bonus for lore levles too
- [+] typo: Enhance which skill enhance (1 left)? ['=next page,?=toggle]
- [+] Show Pain on botl.
* [+] more staves
- [+] low hitpoint warning for pets (or make them shriek, whine, etc)
- [+] CRITKNOCKDOWN
* [+] FINISH GRIZZLY
- [+] undead should be immune to poison!!
- [+] make code to auto add flags to undead.
- [+] if you ever move a door (ie. airblast), automatically open it.
- [+] young wolf shouldn't be able to open a door!
* [+] You throw a dart at the carpet snake. Your dart misses
you.--More--
- [+] no sprinting while burdneed
- [+] blood should be drawn BELOW stairs
- [+] weilded torch should do 1d4 fire damage (counts as a club)
* [+] The skeleton touches a leather belt then recoils in pain!The
skeleton drops a blessed leather belt.The skeleton puts on a
leather belt.
- [+] don't show "you can cast it at power level xxx" for abilities
* [+] more item randomising
- [+] make grey ooze splatter into acid
- [+] "the vine grabs you" if you walk onto an entangling vine.
- [+] don't start monsters within player's los
- [+] properly randomise sticks to snakes
- [+] stirge
- [+] leech (like stirge but can charge/leap, and slightly more hp /
damage)
- [+] treesnake
- [+] constrictor
- [+] cobra
- [+] stickes to snakes - make caster's weapon revert.
- [+] A something comes into view.
- [+] is invisibility code working properly when you see someone use
the invis spell?
- [+] don't include cosmetic objects in 'you see xxx'
* [+] monsters: don't use spells if you don't have lof.
- [+] pets not following around corners if you move diagonally. fixed a
little.
- [+] summon small animals (2-3 x SZ_SMALL)
* [+] jet of water
- [+] summon medium animals (2-4 x SZ_MEDIUM, wolf etc)
- [+] lightning storm (lightbning everyone within los, and more damage)
- [+] summon large animals (SZ_LARGE, horse, bear etc)
2011-05-03 17:34:07 +10:00
|
|
|
int modcounter(flagpile_t *fp, int amt) {
|
|
|
|
flag_t *f;
|
|
|
|
f = hasflag(fp, F_COUNTER);
|
|
|
|
if (f) {
|
|
|
|
f->val[0] += amt;
|
|
|
|
} else {
|
|
|
|
f = addflag(fp, F_COUNTER, amt, NA, NA, NULL);
|
|
|
|
}
|
|
|
|
return f->val[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
void sumflags(flagpile_t *fp, int id, int *val0, int *val1, int *val2) {
|
|
|
|
flag_t *f;
|
|
|
|
if (val0) *val0 = 0;
|
|
|
|
if (val1) *val1 = 0;
|
|
|
|
if (val2) *val2 = 0;
|
|
|
|
for (f = fp->first ; f ; f = f->next) {
|
|
|
|
if (f->id == id) {
|
|
|
|
if (val0) *val0 = *val0 + f->val[0];
|
|
|
|
if (val1) *val1 = *val1 + f->val[1];
|
|
|
|
if (val2) *val2 = *val2 + f->val[2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void timeeffectsflags(flagpile_t *fp) {
|
|
|
|
flag_t *f,*nextf;
|
|
|
|
for (f = fp->first ; f ; f = nextf) {
|
|
|
|
nextf = f->next;
|
2011-03-24 16:09:31 +11:00
|
|
|
timeeffectsflag(f, 1);
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|