2011-02-01 06:16:13 +11:00
|
|
|
#include <assert.h>
|
2010-12-02 12:17:54 +11:00
|
|
|
#include <math.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2011-02-01 06:16:13 +11:00
|
|
|
#include <time.h>
|
2011-03-24 16:09:31 +11:00
|
|
|
#include <unistd.h>
|
2011-02-01 06:16:13 +11:00
|
|
|
#include "ai.h"
|
|
|
|
#include "attack.h"
|
2010-12-02 12:17:54 +11:00
|
|
|
#include "io.h"
|
2011-02-01 06:16:13 +11:00
|
|
|
#include "flag.h"
|
2010-12-02 12:17:54 +11:00
|
|
|
#include "lf.h"
|
|
|
|
#include "map.h"
|
2011-02-01 06:16:13 +11:00
|
|
|
#include "move.h"
|
2010-12-02 12:17:54 +11:00
|
|
|
#include "nexus.h"
|
|
|
|
#include "objects.h"
|
|
|
|
#include "save.h"
|
2011-02-01 06:16:13 +11:00
|
|
|
#include "text.h"
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
material_t *material = NULL,*lastmaterial = NULL;
|
|
|
|
objectclass_t *objectclass = NULL,*lastobjectclass = NULL;
|
|
|
|
objecttype_t *objecttype = NULL,*lastobjecttype = NULL;
|
2011-03-10 16:47:18 +11:00
|
|
|
brand_t *firstbrand = NULL,*lastbrand = NULL;
|
2011-02-16 05:21:33 +11:00
|
|
|
obmod_t *firstobmod = NULL,*lastobmod = NULL;
|
2010-12-02 12:17:54 +11:00
|
|
|
celltype_t *firstcelltype = NULL,*lastcelltype = NULL;
|
2011-03-04 12:22:36 +11:00
|
|
|
command_t *firstcommand = NULL,*lastcommand = NULL;
|
2010-12-02 12:17:54 +11:00
|
|
|
race_t *firstrace = NULL,*lastrace = NULL;
|
* [+] 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
|
|
|
raceclass_t *firstraceclass = NULL,*lastraceclass = NULL;
|
2011-02-01 06:16:13 +11:00
|
|
|
job_t *firstjob = NULL,*lastjob = NULL;
|
2011-03-10 16:47:18 +11:00
|
|
|
skill_t *firstskill = NULL,*lastskill = NULL;
|
2010-12-02 12:17:54 +11:00
|
|
|
map_t *firstmap = NULL,*lastmap = NULL;
|
2010-12-07 18:34:26 +11:00
|
|
|
knowledge_t *knowledge = NULL, *lastknowledge = NULL;
|
2011-03-10 16:47:18 +11:00
|
|
|
hiddenname_t *firsthiddenname = NULL, *lasthiddenname = NULL;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-04-01 10:54:44 +11:00
|
|
|
glyph_t playerglyph,tempglyph;
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// maintains unique lifeform ID numbers
|
|
|
|
long nextlfid = 0;
|
|
|
|
|
|
|
|
int SCREENW = DEF_SCREENW;
|
|
|
|
int SCREENH = DEF_SCREENH;
|
|
|
|
|
|
|
|
// object return list
|
|
|
|
object_t *retobs[MAXPILEOBS+1];
|
|
|
|
int retobscount[MAXPILEOBS+1];
|
|
|
|
int nretobs = 0;
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
FILE *logfile;
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
prompt_t prompt;
|
|
|
|
|
|
|
|
char msghist[MAXHISTORY][BUFLEN];
|
|
|
|
int nmsghist = 0;
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
enum ERROR reason; // global for returning errors
|
2011-02-01 06:16:13 +11:00
|
|
|
void *rdata; // globel for returning data
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
lifeform_t *player = NULL;
|
|
|
|
int gameover;
|
|
|
|
|
2011-03-18 12:25:18 +11:00
|
|
|
enum GAMEMODE gamemode = GM_FIRST;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
long curtime = 0;
|
|
|
|
long timeleft = 0;
|
|
|
|
|
|
|
|
extern int statdirty;
|
|
|
|
|
|
|
|
int needredraw = B_TRUE;
|
|
|
|
int numdraws = 0;
|
|
|
|
|
2011-04-11 15:05:45 +10:00
|
|
|
// for xp list debugging
|
|
|
|
extern race_t **raceposs;
|
|
|
|
extern int *xpposs;
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
2010-12-02 12:17:54 +11:00
|
|
|
int newworld = B_FALSE;
|
2011-02-01 06:16:13 +11:00
|
|
|
object_t *o;
|
2011-03-11 12:25:38 +11:00
|
|
|
char welcomemsg[BUFLEN];
|
2011-03-24 16:09:31 +11:00
|
|
|
int ch;
|
|
|
|
FILE *playerfile = NULL;
|
* [+] 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 x,y;
|
|
|
|
cell_t *c;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
atexit(cleanup);
|
|
|
|
|
2011-03-24 16:09:31 +11:00
|
|
|
while ((ch = getopt(argc, argv, "f:")) != -1) {
|
|
|
|
switch (ch) {
|
|
|
|
case 'f':
|
|
|
|
playerfile = fopen(optarg, "rt");
|
|
|
|
if (!playerfile) {
|
|
|
|
fprintf(stderr, "cannot open player file: %s\n",optarg);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'h':
|
|
|
|
case '?':
|
|
|
|
default:
|
|
|
|
usage(argv[0]);
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
// init params
|
2011-02-01 06:16:13 +11:00
|
|
|
if (init()) {
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
// load whatever maps are available
|
|
|
|
loadall();
|
|
|
|
|
|
|
|
// init graphics
|
|
|
|
initgfx();
|
|
|
|
|
|
|
|
// if no maps, make the initial level
|
|
|
|
if (!firstmap) {
|
|
|
|
newworld = B_TRUE;
|
|
|
|
addmap();
|
2011-05-16 12:03:25 +10:00
|
|
|
createmap(firstmap, 1, RG_FIRSTDUNGEON, H_DUNGEON, NULL, D_NONE);
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
2010-12-07 18:34:26 +11:00
|
|
|
if (!knowledge) {
|
2011-02-01 06:16:13 +11:00
|
|
|
// populate scroll, potion, etc names
|
2010-12-07 18:34:26 +11:00
|
|
|
genhiddennames();
|
|
|
|
}
|
|
|
|
|
|
|
|
// if no player (ie. didn't load a game), add them
|
2010-12-02 12:17:54 +11:00
|
|
|
if (!player) {
|
2011-02-01 06:16:13 +11:00
|
|
|
char *user;
|
|
|
|
char pname[BUFLEN];
|
2011-03-24 16:09:31 +11:00
|
|
|
char buf[BUFLEN];
|
|
|
|
job_t *j = NULL;
|
2011-02-01 06:16:13 +11:00
|
|
|
char ch;
|
|
|
|
cell_t *where;
|
2011-04-14 09:44:29 +10:00
|
|
|
int dir;
|
2011-04-11 15:05:45 +10:00
|
|
|
flag_t *f;
|
2011-02-01 06:16:13 +11:00
|
|
|
|
2011-03-24 16:09:31 +11:00
|
|
|
// read from input file if required
|
|
|
|
if (playerfile) {
|
|
|
|
char *p;
|
|
|
|
while (!feof(playerfile)) {
|
|
|
|
fgets(buf, BUFLEN, playerfile);
|
|
|
|
buf[strlen(buf)-1] = '\0';
|
|
|
|
if (strstr(buf, "job:") == buf) {
|
|
|
|
p = buf + strlen("job:");
|
|
|
|
j = findjobbyname(p);
|
|
|
|
if (j) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fseek(playerfile, 0, SEEK_SET);
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
2011-03-24 16:09:31 +11:00
|
|
|
|
|
|
|
if (!j) {
|
|
|
|
// ask for race
|
|
|
|
initprompt(&prompt, "Select your job:");
|
|
|
|
ch = 'a';
|
|
|
|
for (j = firstjob ; j ; j = j->next) {
|
|
|
|
addchoice(&prompt, ch++, j->name, NULL, j);
|
|
|
|
}
|
|
|
|
j = NULL;
|
|
|
|
while (!j) {
|
|
|
|
getchoice(&prompt);
|
|
|
|
j = prompt.result;
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
|
* [+] 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
|
|
|
// find staircase
|
|
|
|
where = findobinmap(firstmap, OT_STAIRSUP);
|
|
|
|
assert(where);
|
2011-03-22 18:06:28 +11:00
|
|
|
// make sure no lifeforms are there
|
|
|
|
if (where->lf) {
|
|
|
|
killlf(where->lf);
|
|
|
|
}
|
2010-12-07 18:34:26 +11:00
|
|
|
// add player
|
2011-02-01 06:16:13 +11:00
|
|
|
real_addlf(where, R_HUMAN, 1, C_PLAYER); // this will assign 'player'
|
|
|
|
|
|
|
|
user = getenv("USER");
|
|
|
|
if (user) {
|
|
|
|
addflag(player->flags, F_NAME, NA, NA, NA, getenv("USER"));
|
|
|
|
} else {
|
|
|
|
addflag(player->flags, F_NAME, NA, NA, NA, "Anonymous");
|
|
|
|
}
|
|
|
|
givejob(player, j->id);
|
* [+] 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 cases for jobs:
|
2011-04-11 15:05:45 +10:00
|
|
|
if (j->id == J_PIRATE) {
|
|
|
|
flag_t *f;
|
|
|
|
f = lfhasflagval(player, F_HASATTACK, OT_FISTS, NA, NA, NULL);
|
|
|
|
assert(f);
|
|
|
|
f->val[0] = OT_HOOKHAND;
|
|
|
|
sprintf(f->text, "1d4");
|
* [+] 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
|
|
|
} else if (j->id == J_WIZARD) {
|
|
|
|
skill_t *sk;
|
|
|
|
initprompt(&prompt, "Select your spell specialty:");
|
|
|
|
addchoice(&prompt, 'a', getskillname(SK_SS_AIR), NULL, findskill(SK_SS_AIR));
|
* [+] always add webs if there are randomly generated spiders on a level
- [+] non-wood doors
- [+] iron
- [+] only interrupt rest for hunger if it's 'starving' or 'vhungry'
- [+] limit the amount of jumping we can do from athletics skill.
- [+] no message when i lockpick with a -6 combat knife.
- [+] make small corpses give much less nutrition!
- [+] high unarmed skill should give you unarmed attacks with a
1-handed weapon.
- [+] dual weild
- [+] if you have twoweapon skill, when you weild a weapon, say
"weild as secondary weapon? y/n"
- [+] in attackcell(), check if we have a weapon in our second hand
AND are skilled in twoweaponing
- [+] if so, get an attack with both, but with an accuracy penalty
(until adept level)
- [+] make sure shiedl code doesn't accept weapons!
- [+] knockback() can now knock back other lfs that you hit on the way
* [+] faster resting obs (only via R)
- [+] replace F_RESTING with F_ASLEEP. v0 = onpurpose. if v0, you wake
up when at full hp/mp/etc
- [+] implement F_TRAINING with traincounter
- [+] don't say 'rest until nearby allies ar eheald' if they aren't
damaged
- [+] make listen dififculty check dependant on distance to noise
- [+] doesn't make sense for druid to be a vegetarian. use "can only
eat meat when hungry"
- [+] @@ - combine acc+dmg. ie. "weapon: mace (63%,2-9dmg)
- [+] @@ - show both weapons if dualweilding.
- [+] porcupine shoudl have F_SHARP corpse. implement F_CORPSEFLAGS
- [+] create monster - "giant ant" making "giant antlion"!
- [+] giant porcupine
- [+] implement
- [+] should attack ants on sight - f_hatesrace
- [+] if race=hatesrace or baserace = hatesrace, will attack it.
- [+] gust of wind - blow obs away!
- [+] thorns (grow spikes, attackers take dmg)
- [+] f_retaliate, v0=ndice,v1=dsides, v2=damype, text=obname
- [+] major healing (new spell)
2011-05-05 13:12:52 +10:00
|
|
|
addchoice(&prompt, 'i', getskillname(SK_SS_COLD), NULL, findskill(SK_SS_COLD));
|
* [+] 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
|
|
|
addchoice(&prompt, 'f', getskillname(SK_SS_FIRE), NULL, findskill(SK_SS_FIRE));
|
|
|
|
getchoice(&prompt);
|
|
|
|
sk = (skill_t *) prompt.result;
|
|
|
|
giveskill(player, sk->id);
|
* [+] need to set "needredraw" every time we exit:
- [+] make eating take longer - depends on lf size and food sizes
* [+] stop eating if something attacks you!
- [+] change spell code to cope with caster = NULL!!
- [+] why are rooms never more than 2 high
* [+] traps
* [+] eating bug again
* [+] disarm trap skill?
- [+] lots of needredraw bugs
- [+] bug with cursor jumping around lots
- [+] draw darkened visible cells in blue
* [+] shadow cloak
- [+] tree shouldn't prevent resting!
- [+] make plants not attack druids
* [+] cooking
- [+] stop eating if your eating object is no longer with you
* [+] FLAG CORRUPTION BUG
- [+] pet walking back and forth on rotted objects
- [+] purified food shouldn't decay anymore.
- [+] plants shouldn't sleep
- [+] RESTING on statbar not being cleared. the add of f_interrupted
was clearing statdirty before f_asleep got removed in killflag().
- [+] AI: don't eat if in battle
- [+] reduce projectile damage
- [+] show raceclass in statbars
- [+] smoke should make you cough.
- [+] when going up levle, only prompt for spells you can cast?? (don't
show "NOTCASTABLE")
- [+] Your young hawk dies. The stirge releases something!
- [+] sleeping thigns shoudn't follow you up/down stairs.
- [+] when throw'ng an object, don't let it stack (otherwise we might
destroy too much)
- [+] don't draw "c - " for nopickup objects.
- [+] saving throw for traps if you know about it.
- [+] druid - get xp for calming animals
- [+] rogue- get xp for picking locks, disarming traps.
- [+] metal should be immune to most damage types
* [+] make heavy blow need HEAVY weapon, not bashing.
- [+] can't rest/train while levitating!
- [+] gas traps only go off once.
- [+] bug: The goblin throws a boulder at you. A boulder misses you.
- [+] don't give short sword skill to wizard.
- [+] hearing range based on listen skill
* [+] coldness disease:
- [+] CRASH when swapping places
- [+] bug: i can teleport into an impassable object!
- [+] add: "really target (your ally)?"
- [+] give wizards school-based skill instead of manaspike + wildmagic
- [+] LevUp still not being cleared!!!
* [+] why is air wizard being prompted for call lightning at level 2???
* [+] summon weapon (summoning)
- [+] hold portal (mod)
- [+] reveal hidden
- [+] stench (death)
- [+] frostbite (minor but direct cold damage. 1dpower. maxpower 3)
- [+] grease (modific) creates oil in a circle
- [+] fear (death)
- [+] seeinvis (div)
- [+] locate obejct (div) tells you where a seen objcet is.
- [+] swap places (transl) "twiddle"
- [+] fire brand (fire, melee attaks deal fire damage)
- [+] iceedge
- [+] lore (div, temporary knowledge from a particular school?)
- [+] icicle (cold, deals cold dam and knocks enemies away)
* [+] chill (ice, 1d3 damage per exposed body part)
- [+] hail storm (ice, big damage in area)
- [+] wall of ice (creates icy wall, hp based on power)
2011-05-12 11:49:35 +10:00
|
|
|
switch (sk->id) {
|
|
|
|
case SK_SS_AIR:
|
|
|
|
addflag(player->flags, F_CANCAST, OT_S_MIST, NA, NA, NULL);
|
|
|
|
break;
|
|
|
|
case SK_SS_COLD:
|
|
|
|
addflag(player->flags, F_CANCAST, OT_S_FROSTBITE, NA, NA, NULL);
|
|
|
|
break;
|
|
|
|
case SK_SS_FIRE:
|
|
|
|
addflag(player->flags, F_CANCAST, OT_S_SPARK, NA, NA, NULL);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
* [+] 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-04-11 15:05:45 +10:00
|
|
|
}
|
* [+] 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-04-11 15:05:45 +10:00
|
|
|
// read cheat info from player file
|
2011-03-24 16:09:31 +11:00
|
|
|
if (playerfile) {
|
|
|
|
if (parseplayerfile(playerfile, player)) {
|
|
|
|
// error!
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
fclose(playerfile);
|
2011-04-11 15:05:45 +10:00
|
|
|
// TODO: note that we're cheaing
|
2011-03-24 16:09:31 +11:00
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
// player needs hunger
|
|
|
|
addflag(player->flags, F_HUNGER, 0, NA, NA, NULL);
|
|
|
|
|
2011-04-14 09:44:29 +10:00
|
|
|
// kill any other lifeforms around the caster, to make room for pets.
|
|
|
|
for (dir = DC_N; dir <= DC_NW; dir++) {
|
|
|
|
cell_t *c;
|
|
|
|
c = getcellindir(player->cell, dir);
|
|
|
|
if (c && c->lf) {
|
|
|
|
killlf(c->lf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-11 15:05:45 +10:00
|
|
|
// pet / npc / follower
|
|
|
|
f = lfhasflag(player, F_HASPET);
|
|
|
|
if (f) {
|
|
|
|
cell_t *c;
|
|
|
|
race_t *r;
|
|
|
|
lifeform_t *pet;
|
|
|
|
r = findracebyname(f->text);
|
|
|
|
assert(r);
|
|
|
|
|
|
|
|
// create it
|
|
|
|
c = getrandomadjcell(player->cell, WE_WALKABLE, B_ALLOWEXPAND);
|
|
|
|
assert(c);
|
|
|
|
pet = addlf(c, r->id, 1);
|
|
|
|
makefriendly(pet, PERMENANT);
|
|
|
|
// mark us as its master
|
2011-04-14 09:44:29 +10:00
|
|
|
addflag(pet->flags, F_PETOF, player->id, player->cell->x, player->cell->y, NULL);
|
2011-04-11 15:05:45 +10:00
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
getplayernamefull(pname);
|
2011-03-11 12:25:38 +11:00
|
|
|
sprintf(welcomemsg, "Greetings %s, welcome to %snexus!", pname, newworld ? "the new " : "");
|
2011-02-01 06:16:13 +11:00
|
|
|
// 00:00 - 23:59
|
|
|
|
curtime = rnd(0,86399);
|
* [+] 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
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
} else {
|
2011-03-11 12:25:38 +11:00
|
|
|
sprintf(welcomemsg, "Welcome back!");
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
// start game - this will cause debug messages to now
|
|
|
|
// go to the log file instead of stdout.
|
2011-03-18 12:25:18 +11:00
|
|
|
gamemode = GM_GAMESTARTED;
|
2011-02-01 06:16:13 +11:00
|
|
|
timeleft = 0; // reset game timer
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// calculate initial light
|
|
|
|
calclight(player->cell->map);
|
|
|
|
// pre-calc line-of-sight for player
|
|
|
|
precalclos(player);
|
2010-12-02 12:17:54 +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
|
|
|
// don't want any mosnters starting within los of player
|
|
|
|
for (y = 0; y < player->cell->map->h; y++) {
|
|
|
|
for (x = 0; x < player->cell->map->w; x++) {
|
|
|
|
c = getcellat(player->cell->map, x, y);
|
|
|
|
if (c && c->lf && haslos(player, c)) {
|
|
|
|
if (!isplayer(c->lf) && !ispetof(c->lf, player)) {
|
|
|
|
killlf(c->lf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
* [+] need to set "needredraw" every time we exit:
- [+] make eating take longer - depends on lf size and food sizes
* [+] stop eating if something attacks you!
- [+] change spell code to cope with caster = NULL!!
- [+] why are rooms never more than 2 high
* [+] traps
* [+] eating bug again
* [+] disarm trap skill?
- [+] lots of needredraw bugs
- [+] bug with cursor jumping around lots
- [+] draw darkened visible cells in blue
* [+] shadow cloak
- [+] tree shouldn't prevent resting!
- [+] make plants not attack druids
* [+] cooking
- [+] stop eating if your eating object is no longer with you
* [+] FLAG CORRUPTION BUG
- [+] pet walking back and forth on rotted objects
- [+] purified food shouldn't decay anymore.
- [+] plants shouldn't sleep
- [+] RESTING on statbar not being cleared. the add of f_interrupted
was clearing statdirty before f_asleep got removed in killflag().
- [+] AI: don't eat if in battle
- [+] reduce projectile damage
- [+] show raceclass in statbars
- [+] smoke should make you cough.
- [+] when going up levle, only prompt for spells you can cast?? (don't
show "NOTCASTABLE")
- [+] Your young hawk dies. The stirge releases something!
- [+] sleeping thigns shoudn't follow you up/down stairs.
- [+] when throw'ng an object, don't let it stack (otherwise we might
destroy too much)
- [+] don't draw "c - " for nopickup objects.
- [+] saving throw for traps if you know about it.
- [+] druid - get xp for calming animals
- [+] rogue- get xp for picking locks, disarming traps.
- [+] metal should be immune to most damage types
* [+] make heavy blow need HEAVY weapon, not bashing.
- [+] can't rest/train while levitating!
- [+] gas traps only go off once.
- [+] bug: The goblin throws a boulder at you. A boulder misses you.
- [+] don't give short sword skill to wizard.
- [+] hearing range based on listen skill
* [+] coldness disease:
- [+] CRASH when swapping places
- [+] bug: i can teleport into an impassable object!
- [+] add: "really target (your ally)?"
- [+] give wizards school-based skill instead of manaspike + wildmagic
- [+] LevUp still not being cleared!!!
* [+] why is air wizard being prompted for call lightning at level 2???
* [+] summon weapon (summoning)
- [+] hold portal (mod)
- [+] reveal hidden
- [+] stench (death)
- [+] frostbite (minor but direct cold damage. 1dpower. maxpower 3)
- [+] grease (modific) creates oil in a circle
- [+] fear (death)
- [+] seeinvis (div)
- [+] locate obejct (div) tells you where a seen objcet is.
- [+] swap places (transl) "twiddle"
- [+] fire brand (fire, melee attaks deal fire damage)
- [+] iceedge
- [+] lore (div, temporary knowledge from a particular school?)
- [+] icicle (cold, deals cold dam and knocks enemies away)
* [+] chill (ice, 1d3 damage per exposed body part)
- [+] hail storm (ice, big damage in area)
- [+] wall of ice (creates icy wall, hp based on power)
2011-05-12 11:49:35 +10:00
|
|
|
needredraw = B_TRUE;
|
|
|
|
statdirty = B_TRUE;
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
// show level
|
|
|
|
drawscreen();
|
|
|
|
|
2011-03-11 12:25:38 +11:00
|
|
|
msg("%s",welcomemsg);
|
|
|
|
more();
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
// MAIN LOOP
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
// basic flow is:
|
|
|
|
//
|
|
|
|
// donextturn() - process a turn for a lifeform
|
|
|
|
// turneffectslf() Rest effects, Damage from floor objects, etc
|
|
|
|
// lifeform takes action
|
|
|
|
// checkdeath() - check for object/player death. remove dead things.
|
|
|
|
// timeeffectsworld() Fires burn out, ice melts, etc
|
|
|
|
// Also keeps lf->timespent values under control.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// redraw screen
|
|
|
|
//
|
|
|
|
// checkendgame() - has the game ended yet?
|
|
|
|
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
gameover = B_FALSE;
|
|
|
|
while (!gameover) {
|
2011-02-01 06:16:13 +11:00
|
|
|
map_t *curmap;
|
|
|
|
curmap = player->cell->map;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// default to no redraw - donextturn() will change this if needed.
|
|
|
|
needredraw = B_FALSE;
|
|
|
|
numdraws = 0;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// someone has a turn - this will then call taketime -> timehappens();
|
|
|
|
donextturn(curmap);
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// update lifeform structue to figure out who goes next
|
|
|
|
//timehappens(curmap);
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// show level (if required)
|
|
|
|
//if (haslos(player, curmap->lf->cell)) {
|
2010-12-02 12:17:54 +11:00
|
|
|
drawscreen();
|
2011-02-01 06:16:13 +11:00
|
|
|
//dblog("**** END of turn, numdraws = %d", numdraws);
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
// check end of game
|
|
|
|
checkendgame();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// identify all objects
|
|
|
|
for (o = player->pack->first ; o ; o = o->next) {
|
|
|
|
identify(o);
|
|
|
|
}
|
|
|
|
// show possessions
|
|
|
|
dofinaloblist(player->pack);
|
2010-12-02 12:17:54 +11:00
|
|
|
// print tombstone
|
|
|
|
tombstone(player);
|
2011-02-01 06:16:13 +11:00
|
|
|
return B_FALSE;
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
2011-04-01 10:54:44 +11:00
|
|
|
celltype_t *addcelltype(int id, char *name, char glyph, int colour, int solid, int transparent, enum MATERIAL mat) {
|
2010-12-02 12:17:54 +11:00
|
|
|
celltype_t *a;
|
|
|
|
|
|
|
|
// add to the end of the list
|
|
|
|
if (firstcelltype == NULL) {
|
|
|
|
firstcelltype = malloc(sizeof(celltype_t));
|
|
|
|
a = firstcelltype;
|
|
|
|
a->prev = NULL;
|
|
|
|
} else {
|
|
|
|
// go to end of list
|
|
|
|
a = lastcelltype;
|
|
|
|
a->next = malloc(sizeof(celltype_t));
|
|
|
|
a->next->prev = a;
|
|
|
|
a = a->next;
|
|
|
|
}
|
|
|
|
lastcelltype = a;
|
|
|
|
a->next = NULL;
|
|
|
|
|
|
|
|
// set props
|
|
|
|
a->id = id;
|
2011-02-01 06:16:13 +11:00
|
|
|
a->name = strdup(name);
|
2011-04-01 10:54:44 +11:00
|
|
|
a->glyph.ch = glyph;
|
|
|
|
a->glyph.colour = colour;
|
2010-12-02 12:17:54 +11:00
|
|
|
a->solid = solid;
|
|
|
|
a->transparent = transparent;
|
2011-02-01 06:16:13 +11:00
|
|
|
a->material = findmaterial(mat);
|
|
|
|
|
|
|
|
a->flags = addflagpile(NULL, NULL);
|
|
|
|
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2011-03-04 12:22:36 +11:00
|
|
|
command_t *addcommand(enum COMMAND id, char ch, char *desc) {
|
|
|
|
command_t *a;
|
|
|
|
|
|
|
|
// add to the end of the list
|
|
|
|
if (firstcommand == NULL) {
|
|
|
|
firstcommand = malloc(sizeof(command_t));
|
|
|
|
a = firstcommand;
|
|
|
|
a->prev = NULL;
|
|
|
|
} else {
|
|
|
|
// go to end of list
|
|
|
|
a = lastcommand;
|
|
|
|
a->next = malloc(sizeof(command_t));
|
|
|
|
a->next->prev = a;
|
|
|
|
a = a->next;
|
|
|
|
}
|
|
|
|
lastcommand = a;
|
|
|
|
a->next = NULL;
|
|
|
|
|
|
|
|
// set props
|
|
|
|
a->id = id;
|
|
|
|
a->ch = ch;
|
|
|
|
a->desc = strdup(desc);
|
|
|
|
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
void checkdeath(void) {
|
|
|
|
lifeform_t *lf, *nextlf;
|
|
|
|
int x,y;
|
|
|
|
for (lf = player->cell->map->lf; lf ; lf = nextlf) {
|
|
|
|
nextlf = lf->next;
|
|
|
|
|
2011-04-08 13:18:54 +10:00
|
|
|
// check for object death
|
|
|
|
removedeadobs(lf->pack);
|
2011-02-01 06:16:13 +11:00
|
|
|
// check for death
|
|
|
|
if (lf->hp <= 0) {
|
|
|
|
// die!
|
|
|
|
die(lf);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// check for object death on map
|
|
|
|
for (y = 0; y < player->cell->map->h; y++) {
|
|
|
|
for (x = 0; x < player->cell->map->w; x++) {
|
|
|
|
cell_t *c;
|
|
|
|
c = getcellat(player->cell->map, x, y);
|
|
|
|
if (c) {
|
|
|
|
removedeadobs(c->obpile);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
void checkendgame(void) {
|
|
|
|
if (!player->alive) {
|
|
|
|
gameover = B_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void cleanup(void) {
|
2011-04-11 15:05:45 +10:00
|
|
|
|
|
|
|
free(xpposs);
|
|
|
|
free(raceposs);
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
fclose(logfile);
|
|
|
|
cleanupgfx();
|
2011-02-16 05:21:33 +11:00
|
|
|
|
|
|
|
// free maps
|
|
|
|
// free knowledge
|
2011-03-10 16:47:18 +11:00
|
|
|
// free brands
|
2011-02-16 05:21:33 +11:00
|
|
|
// free obtypes
|
|
|
|
// free objects
|
|
|
|
// free materials
|
|
|
|
// free races
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
2011-03-24 16:09:31 +11:00
|
|
|
void dobresnham(int d, int xinc1, int yinc1, int dinc1, int xinc2, int yinc2, int dinc2, int *xinc, int *yinc, int *dinc) {
|
|
|
|
if (d < 0) {
|
|
|
|
*xinc = xinc1;
|
|
|
|
*yinc = yinc1;
|
|
|
|
*dinc = dinc1;
|
|
|
|
} else {
|
|
|
|
*xinc = xinc2;
|
|
|
|
*yinc = yinc2;
|
|
|
|
*dinc = dinc2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
void donextturn(map_t *map) {
|
|
|
|
lifeform_t *who;
|
2011-02-16 05:21:33 +11:00
|
|
|
int db = B_FALSE;
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
who = map->lf;
|
2011-02-16 05:21:33 +11:00
|
|
|
if (db) dblog("**** donextturn for: id %d %s", who->id, who->race->name);
|
2011-02-01 06:16:13 +11:00
|
|
|
|
2011-04-08 13:18:54 +10:00
|
|
|
assert(who->timespent == 0);
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
turneffectslf(who);
|
|
|
|
|
|
|
|
// calculate light
|
|
|
|
calclight(map);
|
|
|
|
// pre-calculate line of sight for this lifeform
|
|
|
|
precalclos(who);
|
|
|
|
|
* [+] need to set "needredraw" every time we exit:
- [+] make eating take longer - depends on lf size and food sizes
* [+] stop eating if something attacks you!
- [+] change spell code to cope with caster = NULL!!
- [+] why are rooms never more than 2 high
* [+] traps
* [+] eating bug again
* [+] disarm trap skill?
- [+] lots of needredraw bugs
- [+] bug with cursor jumping around lots
- [+] draw darkened visible cells in blue
* [+] shadow cloak
- [+] tree shouldn't prevent resting!
- [+] make plants not attack druids
* [+] cooking
- [+] stop eating if your eating object is no longer with you
* [+] FLAG CORRUPTION BUG
- [+] pet walking back and forth on rotted objects
- [+] purified food shouldn't decay anymore.
- [+] plants shouldn't sleep
- [+] RESTING on statbar not being cleared. the add of f_interrupted
was clearing statdirty before f_asleep got removed in killflag().
- [+] AI: don't eat if in battle
- [+] reduce projectile damage
- [+] show raceclass in statbars
- [+] smoke should make you cough.
- [+] when going up levle, only prompt for spells you can cast?? (don't
show "NOTCASTABLE")
- [+] Your young hawk dies. The stirge releases something!
- [+] sleeping thigns shoudn't follow you up/down stairs.
- [+] when throw'ng an object, don't let it stack (otherwise we might
destroy too much)
- [+] don't draw "c - " for nopickup objects.
- [+] saving throw for traps if you know about it.
- [+] druid - get xp for calming animals
- [+] rogue- get xp for picking locks, disarming traps.
- [+] metal should be immune to most damage types
* [+] make heavy blow need HEAVY weapon, not bashing.
- [+] can't rest/train while levitating!
- [+] gas traps only go off once.
- [+] bug: The goblin throws a boulder at you. A boulder misses you.
- [+] don't give short sword skill to wizard.
- [+] hearing range based on listen skill
* [+] coldness disease:
- [+] CRASH when swapping places
- [+] bug: i can teleport into an impassable object!
- [+] add: "really target (your ally)?"
- [+] give wizards school-based skill instead of manaspike + wildmagic
- [+] LevUp still not being cleared!!!
* [+] why is air wizard being prompted for call lightning at level 2???
* [+] summon weapon (summoning)
- [+] hold portal (mod)
- [+] reveal hidden
- [+] stench (death)
- [+] frostbite (minor but direct cold damage. 1dpower. maxpower 3)
- [+] grease (modific) creates oil in a circle
- [+] fear (death)
- [+] seeinvis (div)
- [+] locate obejct (div) tells you where a seen objcet is.
- [+] swap places (transl) "twiddle"
- [+] fire brand (fire, melee attaks deal fire damage)
- [+] iceedge
- [+] lore (div, temporary knowledge from a particular school?)
- [+] icicle (cold, deals cold dam and knocks enemies away)
* [+] chill (ice, 1d3 damage per exposed body part)
- [+] hail storm (ice, big damage in area)
- [+] wall of ice (creates icy wall, hp based on power)
2011-05-12 11:49:35 +10:00
|
|
|
/*
|
2011-03-16 15:45:46 +11:00
|
|
|
if (isplayer(who) || cansee(player, who)) {
|
2011-02-01 06:16:13 +11:00
|
|
|
needredraw = B_TRUE;
|
2011-03-18 12:25:18 +11:00
|
|
|
drawscreen();
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
* [+] need to set "needredraw" every time we exit:
- [+] make eating take longer - depends on lf size and food sizes
* [+] stop eating if something attacks you!
- [+] change spell code to cope with caster = NULL!!
- [+] why are rooms never more than 2 high
* [+] traps
* [+] eating bug again
* [+] disarm trap skill?
- [+] lots of needredraw bugs
- [+] bug with cursor jumping around lots
- [+] draw darkened visible cells in blue
* [+] shadow cloak
- [+] tree shouldn't prevent resting!
- [+] make plants not attack druids
* [+] cooking
- [+] stop eating if your eating object is no longer with you
* [+] FLAG CORRUPTION BUG
- [+] pet walking back and forth on rotted objects
- [+] purified food shouldn't decay anymore.
- [+] plants shouldn't sleep
- [+] RESTING on statbar not being cleared. the add of f_interrupted
was clearing statdirty before f_asleep got removed in killflag().
- [+] AI: don't eat if in battle
- [+] reduce projectile damage
- [+] show raceclass in statbars
- [+] smoke should make you cough.
- [+] when going up levle, only prompt for spells you can cast?? (don't
show "NOTCASTABLE")
- [+] Your young hawk dies. The stirge releases something!
- [+] sleeping thigns shoudn't follow you up/down stairs.
- [+] when throw'ng an object, don't let it stack (otherwise we might
destroy too much)
- [+] don't draw "c - " for nopickup objects.
- [+] saving throw for traps if you know about it.
- [+] druid - get xp for calming animals
- [+] rogue- get xp for picking locks, disarming traps.
- [+] metal should be immune to most damage types
* [+] make heavy blow need HEAVY weapon, not bashing.
- [+] can't rest/train while levitating!
- [+] gas traps only go off once.
- [+] bug: The goblin throws a boulder at you. A boulder misses you.
- [+] don't give short sword skill to wizard.
- [+] hearing range based on listen skill
* [+] coldness disease:
- [+] CRASH when swapping places
- [+] bug: i can teleport into an impassable object!
- [+] add: "really target (your ally)?"
- [+] give wizards school-based skill instead of manaspike + wildmagic
- [+] LevUp still not being cleared!!!
* [+] why is air wizard being prompted for call lightning at level 2???
* [+] summon weapon (summoning)
- [+] hold portal (mod)
- [+] reveal hidden
- [+] stench (death)
- [+] frostbite (minor but direct cold damage. 1dpower. maxpower 3)
- [+] grease (modific) creates oil in a circle
- [+] fear (death)
- [+] seeinvis (div)
- [+] locate obejct (div) tells you where a seen objcet is.
- [+] swap places (transl) "twiddle"
- [+] fire brand (fire, melee attaks deal fire damage)
- [+] iceedge
- [+] lore (div, temporary knowledge from a particular school?)
- [+] icicle (cold, deals cold dam and knocks enemies away)
* [+] chill (ice, 1d3 damage per exposed body part)
- [+] hail storm (ice, big damage in area)
- [+] wall of ice (creates icy wall, hp based on power)
2011-05-12 11:49:35 +10:00
|
|
|
*/
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// update gun targets
|
|
|
|
autotarget(who);
|
|
|
|
|
|
|
|
|
|
|
|
// keep looping until they actually do something or are dead!
|
|
|
|
while (who->timespent == 0) {
|
|
|
|
if (isdead(who)) {
|
|
|
|
// skip turn
|
|
|
|
taketime(who, SPEED_DEAD);
|
|
|
|
} else {
|
|
|
|
// do we need to run away from something?
|
|
|
|
if (!flee(who)) {
|
|
|
|
int donormalmove = B_TRUE;
|
|
|
|
flag_t *f;
|
|
|
|
|
* [+] need to set "needredraw" every time we exit:
- [+] make eating take longer - depends on lf size and food sizes
* [+] stop eating if something attacks you!
- [+] change spell code to cope with caster = NULL!!
- [+] why are rooms never more than 2 high
* [+] traps
* [+] eating bug again
* [+] disarm trap skill?
- [+] lots of needredraw bugs
- [+] bug with cursor jumping around lots
- [+] draw darkened visible cells in blue
* [+] shadow cloak
- [+] tree shouldn't prevent resting!
- [+] make plants not attack druids
* [+] cooking
- [+] stop eating if your eating object is no longer with you
* [+] FLAG CORRUPTION BUG
- [+] pet walking back and forth on rotted objects
- [+] purified food shouldn't decay anymore.
- [+] plants shouldn't sleep
- [+] RESTING on statbar not being cleared. the add of f_interrupted
was clearing statdirty before f_asleep got removed in killflag().
- [+] AI: don't eat if in battle
- [+] reduce projectile damage
- [+] show raceclass in statbars
- [+] smoke should make you cough.
- [+] when going up levle, only prompt for spells you can cast?? (don't
show "NOTCASTABLE")
- [+] Your young hawk dies. The stirge releases something!
- [+] sleeping thigns shoudn't follow you up/down stairs.
- [+] when throw'ng an object, don't let it stack (otherwise we might
destroy too much)
- [+] don't draw "c - " for nopickup objects.
- [+] saving throw for traps if you know about it.
- [+] druid - get xp for calming animals
- [+] rogue- get xp for picking locks, disarming traps.
- [+] metal should be immune to most damage types
* [+] make heavy blow need HEAVY weapon, not bashing.
- [+] can't rest/train while levitating!
- [+] gas traps only go off once.
- [+] bug: The goblin throws a boulder at you. A boulder misses you.
- [+] don't give short sword skill to wizard.
- [+] hearing range based on listen skill
* [+] coldness disease:
- [+] CRASH when swapping places
- [+] bug: i can teleport into an impassable object!
- [+] add: "really target (your ally)?"
- [+] give wizards school-based skill instead of manaspike + wildmagic
- [+] LevUp still not being cleared!!!
* [+] why is air wizard being prompted for call lightning at level 2???
* [+] summon weapon (summoning)
- [+] hold portal (mod)
- [+] reveal hidden
- [+] stench (death)
- [+] frostbite (minor but direct cold damage. 1dpower. maxpower 3)
- [+] grease (modific) creates oil in a circle
- [+] fear (death)
- [+] seeinvis (div)
- [+] locate obejct (div) tells you where a seen objcet is.
- [+] swap places (transl) "twiddle"
- [+] fire brand (fire, melee attaks deal fire damage)
- [+] iceedge
- [+] lore (div, temporary knowledge from a particular school?)
- [+] icicle (cold, deals cold dam and knocks enemies away)
* [+] chill (ice, 1d3 damage per exposed body part)
- [+] hail storm (ice, big damage in area)
- [+] wall of ice (creates icy wall, hp based on power)
2011-05-12 11:49:35 +10:00
|
|
|
// eating?
|
|
|
|
if (donormalmove) {
|
|
|
|
f = lfhasflag(who, F_EATING);
|
|
|
|
if (f) {
|
|
|
|
object_t *o;
|
|
|
|
o = findobbyid(who->pack, atol(f->text));
|
|
|
|
if (!o) {
|
|
|
|
o = findobidinmap(who->cell->map, atol(f->text));
|
|
|
|
}
|
|
|
|
if (o && caneat(who, o) && (getoblocation(o) == who->cell)) {
|
|
|
|
eat(who,o);
|
|
|
|
donormalmove = B_FALSE;
|
|
|
|
} else {
|
|
|
|
killflag(f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// resting?
|
|
|
|
if (donormalmove) {
|
* [+] always add webs if there are randomly generated spiders on a level
- [+] non-wood doors
- [+] iron
- [+] only interrupt rest for hunger if it's 'starving' or 'vhungry'
- [+] limit the amount of jumping we can do from athletics skill.
- [+] no message when i lockpick with a -6 combat knife.
- [+] make small corpses give much less nutrition!
- [+] high unarmed skill should give you unarmed attacks with a
1-handed weapon.
- [+] dual weild
- [+] if you have twoweapon skill, when you weild a weapon, say
"weild as secondary weapon? y/n"
- [+] in attackcell(), check if we have a weapon in our second hand
AND are skilled in twoweaponing
- [+] if so, get an attack with both, but with an accuracy penalty
(until adept level)
- [+] make sure shiedl code doesn't accept weapons!
- [+] knockback() can now knock back other lfs that you hit on the way
* [+] faster resting obs (only via R)
- [+] replace F_RESTING with F_ASLEEP. v0 = onpurpose. if v0, you wake
up when at full hp/mp/etc
- [+] implement F_TRAINING with traincounter
- [+] don't say 'rest until nearby allies ar eheald' if they aren't
damaged
- [+] make listen dififculty check dependant on distance to noise
- [+] doesn't make sense for druid to be a vegetarian. use "can only
eat meat when hungry"
- [+] @@ - combine acc+dmg. ie. "weapon: mace (63%,2-9dmg)
- [+] @@ - show both weapons if dualweilding.
- [+] porcupine shoudl have F_SHARP corpse. implement F_CORPSEFLAGS
- [+] create monster - "giant ant" making "giant antlion"!
- [+] giant porcupine
- [+] implement
- [+] should attack ants on sight - f_hatesrace
- [+] if race=hatesrace or baserace = hatesrace, will attack it.
- [+] gust of wind - blow obs away!
- [+] thorns (grow spikes, attackers take dmg)
- [+] f_retaliate, v0=ndice,v1=dsides, v2=damype, text=obname
- [+] major healing (new spell)
2011-05-05 13:12:52 +10:00
|
|
|
f = isresting(who);
|
|
|
|
if (!f) {
|
|
|
|
f = lfhasflag(who, F_TRAINING);
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
if (f) {
|
2011-04-06 17:27:55 +10:00
|
|
|
// check for interrupt of resting...
|
|
|
|
if (isplayer(who) && checkforkey()) {
|
* [+] always add webs if there are randomly generated spiders on a level
- [+] non-wood doors
- [+] iron
- [+] only interrupt rest for hunger if it's 'starving' or 'vhungry'
- [+] limit the amount of jumping we can do from athletics skill.
- [+] no message when i lockpick with a -6 combat knife.
- [+] make small corpses give much less nutrition!
- [+] high unarmed skill should give you unarmed attacks with a
1-handed weapon.
- [+] dual weild
- [+] if you have twoweapon skill, when you weild a weapon, say
"weild as secondary weapon? y/n"
- [+] in attackcell(), check if we have a weapon in our second hand
AND are skilled in twoweaponing
- [+] if so, get an attack with both, but with an accuracy penalty
(until adept level)
- [+] make sure shiedl code doesn't accept weapons!
- [+] knockback() can now knock back other lfs that you hit on the way
* [+] faster resting obs (only via R)
- [+] replace F_RESTING with F_ASLEEP. v0 = onpurpose. if v0, you wake
up when at full hp/mp/etc
- [+] implement F_TRAINING with traincounter
- [+] don't say 'rest until nearby allies ar eheald' if they aren't
damaged
- [+] make listen dififculty check dependant on distance to noise
- [+] doesn't make sense for druid to be a vegetarian. use "can only
eat meat when hungry"
- [+] @@ - combine acc+dmg. ie. "weapon: mace (63%,2-9dmg)
- [+] @@ - show both weapons if dualweilding.
- [+] porcupine shoudl have F_SHARP corpse. implement F_CORPSEFLAGS
- [+] create monster - "giant ant" making "giant antlion"!
- [+] giant porcupine
- [+] implement
- [+] should attack ants on sight - f_hatesrace
- [+] if race=hatesrace or baserace = hatesrace, will attack it.
- [+] gust of wind - blow obs away!
- [+] thorns (grow spikes, attackers take dmg)
- [+] f_retaliate, v0=ndice,v1=dsides, v2=damype, text=obname
- [+] major healing (new spell)
2011-05-05 13:12:52 +10:00
|
|
|
msg("Stopped %s.",(f->id == F_TRAINING) ? "training" : "resting");
|
2011-04-06 17:27:55 +10:00
|
|
|
killflag(f);
|
|
|
|
} else {
|
* [+] need to set "needredraw" every time we exit:
- [+] make eating take longer - depends on lf size and food sizes
* [+] stop eating if something attacks you!
- [+] change spell code to cope with caster = NULL!!
- [+] why are rooms never more than 2 high
* [+] traps
* [+] eating bug again
* [+] disarm trap skill?
- [+] lots of needredraw bugs
- [+] bug with cursor jumping around lots
- [+] draw darkened visible cells in blue
* [+] shadow cloak
- [+] tree shouldn't prevent resting!
- [+] make plants not attack druids
* [+] cooking
- [+] stop eating if your eating object is no longer with you
* [+] FLAG CORRUPTION BUG
- [+] pet walking back and forth on rotted objects
- [+] purified food shouldn't decay anymore.
- [+] plants shouldn't sleep
- [+] RESTING on statbar not being cleared. the add of f_interrupted
was clearing statdirty before f_asleep got removed in killflag().
- [+] AI: don't eat if in battle
- [+] reduce projectile damage
- [+] show raceclass in statbars
- [+] smoke should make you cough.
- [+] when going up levle, only prompt for spells you can cast?? (don't
show "NOTCASTABLE")
- [+] Your young hawk dies. The stirge releases something!
- [+] sleeping thigns shoudn't follow you up/down stairs.
- [+] when throw'ng an object, don't let it stack (otherwise we might
destroy too much)
- [+] don't draw "c - " for nopickup objects.
- [+] saving throw for traps if you know about it.
- [+] druid - get xp for calming animals
- [+] rogue- get xp for picking locks, disarming traps.
- [+] metal should be immune to most damage types
* [+] make heavy blow need HEAVY weapon, not bashing.
- [+] can't rest/train while levitating!
- [+] gas traps only go off once.
- [+] bug: The goblin throws a boulder at you. A boulder misses you.
- [+] don't give short sword skill to wizard.
- [+] hearing range based on listen skill
* [+] coldness disease:
- [+] CRASH when swapping places
- [+] bug: i can teleport into an impassable object!
- [+] add: "really target (your ally)?"
- [+] give wizards school-based skill instead of manaspike + wildmagic
- [+] LevUp still not being cleared!!!
* [+] why is air wizard being prompted for call lightning at level 2???
* [+] summon weapon (summoning)
- [+] hold portal (mod)
- [+] reveal hidden
- [+] stench (death)
- [+] frostbite (minor but direct cold damage. 1dpower. maxpower 3)
- [+] grease (modific) creates oil in a circle
- [+] fear (death)
- [+] seeinvis (div)
- [+] locate obejct (div) tells you where a seen objcet is.
- [+] swap places (transl) "twiddle"
- [+] fire brand (fire, melee attaks deal fire damage)
- [+] iceedge
- [+] lore (div, temporary knowledge from a particular school?)
- [+] icicle (cold, deals cold dam and knocks enemies away)
* [+] chill (ice, 1d3 damage per exposed body part)
- [+] hail storm (ice, big damage in area)
- [+] wall of ice (creates icy wall, hp based on power)
2011-05-12 11:49:35 +10:00
|
|
|
if (isplayer(who)) {
|
|
|
|
if (++who->turnsskipped >= 10) {
|
|
|
|
msg("Time passes...");
|
|
|
|
who->turnsskipped = 0;
|
|
|
|
}
|
|
|
|
}
|
2011-04-06 17:27:55 +10:00
|
|
|
rest(who, B_TRUE);
|
|
|
|
donormalmove = B_FALSE;
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
}
|
2010-12-02 12:17:54 +11:00
|
|
|
|
* [+] always add webs if there are randomly generated spiders on a level
- [+] non-wood doors
- [+] iron
- [+] only interrupt rest for hunger if it's 'starving' or 'vhungry'
- [+] limit the amount of jumping we can do from athletics skill.
- [+] no message when i lockpick with a -6 combat knife.
- [+] make small corpses give much less nutrition!
- [+] high unarmed skill should give you unarmed attacks with a
1-handed weapon.
- [+] dual weild
- [+] if you have twoweapon skill, when you weild a weapon, say
"weild as secondary weapon? y/n"
- [+] in attackcell(), check if we have a weapon in our second hand
AND are skilled in twoweaponing
- [+] if so, get an attack with both, but with an accuracy penalty
(until adept level)
- [+] make sure shiedl code doesn't accept weapons!
- [+] knockback() can now knock back other lfs that you hit on the way
* [+] faster resting obs (only via R)
- [+] replace F_RESTING with F_ASLEEP. v0 = onpurpose. if v0, you wake
up when at full hp/mp/etc
- [+] implement F_TRAINING with traincounter
- [+] don't say 'rest until nearby allies ar eheald' if they aren't
damaged
- [+] make listen dififculty check dependant on distance to noise
- [+] doesn't make sense for druid to be a vegetarian. use "can only
eat meat when hungry"
- [+] @@ - combine acc+dmg. ie. "weapon: mace (63%,2-9dmg)
- [+] @@ - show both weapons if dualweilding.
- [+] porcupine shoudl have F_SHARP corpse. implement F_CORPSEFLAGS
- [+] create monster - "giant ant" making "giant antlion"!
- [+] giant porcupine
- [+] implement
- [+] should attack ants on sight - f_hatesrace
- [+] if race=hatesrace or baserace = hatesrace, will attack it.
- [+] gust of wind - blow obs away!
- [+] thorns (grow spikes, attackers take dmg)
- [+] f_retaliate, v0=ndice,v1=dsides, v2=damype, text=obname
- [+] major healing (new spell)
2011-05-05 13:12:52 +10:00
|
|
|
|
|
|
|
if (donormalmove) {
|
|
|
|
// paralyzed etc?
|
|
|
|
if (isimmobile(who)) {
|
* [+] need to set "needredraw" every time we exit:
- [+] make eating take longer - depends on lf size and food sizes
* [+] stop eating if something attacks you!
- [+] change spell code to cope with caster = NULL!!
- [+] why are rooms never more than 2 high
* [+] traps
* [+] eating bug again
* [+] disarm trap skill?
- [+] lots of needredraw bugs
- [+] bug with cursor jumping around lots
- [+] draw darkened visible cells in blue
* [+] shadow cloak
- [+] tree shouldn't prevent resting!
- [+] make plants not attack druids
* [+] cooking
- [+] stop eating if your eating object is no longer with you
* [+] FLAG CORRUPTION BUG
- [+] pet walking back and forth on rotted objects
- [+] purified food shouldn't decay anymore.
- [+] plants shouldn't sleep
- [+] RESTING on statbar not being cleared. the add of f_interrupted
was clearing statdirty before f_asleep got removed in killflag().
- [+] AI: don't eat if in battle
- [+] reduce projectile damage
- [+] show raceclass in statbars
- [+] smoke should make you cough.
- [+] when going up levle, only prompt for spells you can cast?? (don't
show "NOTCASTABLE")
- [+] Your young hawk dies. The stirge releases something!
- [+] sleeping thigns shoudn't follow you up/down stairs.
- [+] when throw'ng an object, don't let it stack (otherwise we might
destroy too much)
- [+] don't draw "c - " for nopickup objects.
- [+] saving throw for traps if you know about it.
- [+] druid - get xp for calming animals
- [+] rogue- get xp for picking locks, disarming traps.
- [+] metal should be immune to most damage types
* [+] make heavy blow need HEAVY weapon, not bashing.
- [+] can't rest/train while levitating!
- [+] gas traps only go off once.
- [+] bug: The goblin throws a boulder at you. A boulder misses you.
- [+] don't give short sword skill to wizard.
- [+] hearing range based on listen skill
* [+] coldness disease:
- [+] CRASH when swapping places
- [+] bug: i can teleport into an impassable object!
- [+] add: "really target (your ally)?"
- [+] give wizards school-based skill instead of manaspike + wildmagic
- [+] LevUp still not being cleared!!!
* [+] why is air wizard being prompted for call lightning at level 2???
* [+] summon weapon (summoning)
- [+] hold portal (mod)
- [+] reveal hidden
- [+] stench (death)
- [+] frostbite (minor but direct cold damage. 1dpower. maxpower 3)
- [+] grease (modific) creates oil in a circle
- [+] fear (death)
- [+] seeinvis (div)
- [+] locate obejct (div) tells you where a seen objcet is.
- [+] swap places (transl) "twiddle"
- [+] fire brand (fire, melee attaks deal fire damage)
- [+] iceedge
- [+] lore (div, temporary knowledge from a particular school?)
- [+] icicle (cold, deals cold dam and knocks enemies away)
* [+] chill (ice, 1d3 damage per exposed body part)
- [+] hail storm (ice, big damage in area)
- [+] wall of ice (creates icy wall, hp based on power)
2011-05-12 11:49:35 +10:00
|
|
|
if (isplayer(who)) {
|
|
|
|
if (++who->turnsskipped >= 10) {
|
|
|
|
msg("Time passes...");
|
|
|
|
who->turnsskipped = 0;
|
|
|
|
}
|
|
|
|
}
|
* [+] always add webs if there are randomly generated spiders on a level
- [+] non-wood doors
- [+] iron
- [+] only interrupt rest for hunger if it's 'starving' or 'vhungry'
- [+] limit the amount of jumping we can do from athletics skill.
- [+] no message when i lockpick with a -6 combat knife.
- [+] make small corpses give much less nutrition!
- [+] high unarmed skill should give you unarmed attacks with a
1-handed weapon.
- [+] dual weild
- [+] if you have twoweapon skill, when you weild a weapon, say
"weild as secondary weapon? y/n"
- [+] in attackcell(), check if we have a weapon in our second hand
AND are skilled in twoweaponing
- [+] if so, get an attack with both, but with an accuracy penalty
(until adept level)
- [+] make sure shiedl code doesn't accept weapons!
- [+] knockback() can now knock back other lfs that you hit on the way
* [+] faster resting obs (only via R)
- [+] replace F_RESTING with F_ASLEEP. v0 = onpurpose. if v0, you wake
up when at full hp/mp/etc
- [+] implement F_TRAINING with traincounter
- [+] don't say 'rest until nearby allies ar eheald' if they aren't
damaged
- [+] make listen dififculty check dependant on distance to noise
- [+] doesn't make sense for druid to be a vegetarian. use "can only
eat meat when hungry"
- [+] @@ - combine acc+dmg. ie. "weapon: mace (63%,2-9dmg)
- [+] @@ - show both weapons if dualweilding.
- [+] porcupine shoudl have F_SHARP corpse. implement F_CORPSEFLAGS
- [+] create monster - "giant ant" making "giant antlion"!
- [+] giant porcupine
- [+] implement
- [+] should attack ants on sight - f_hatesrace
- [+] if race=hatesrace or baserace = hatesrace, will attack it.
- [+] gust of wind - blow obs away!
- [+] thorns (grow spikes, attackers take dmg)
- [+] f_retaliate, v0=ndice,v1=dsides, v2=damype, text=obname
- [+] major healing (new spell)
2011-05-05 13:12:52 +10:00
|
|
|
rest(who, B_FALSE);
|
|
|
|
donormalmove = B_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
if (donormalmove) {
|
|
|
|
if (isplayer(who)) {
|
|
|
|
drawcursor();
|
|
|
|
// find out what player wants to do
|
|
|
|
handleinput();
|
|
|
|
} else {
|
|
|
|
// do ai move
|
2011-04-14 09:44:29 +10:00
|
|
|
aiturn(who);
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-12-02 12:17:54 +11:00
|
|
|
|
* [+] always add webs if there are randomly generated spiders on a level
- [+] non-wood doors
- [+] iron
- [+] only interrupt rest for hunger if it's 'starving' or 'vhungry'
- [+] limit the amount of jumping we can do from athletics skill.
- [+] no message when i lockpick with a -6 combat knife.
- [+] make small corpses give much less nutrition!
- [+] high unarmed skill should give you unarmed attacks with a
1-handed weapon.
- [+] dual weild
- [+] if you have twoweapon skill, when you weild a weapon, say
"weild as secondary weapon? y/n"
- [+] in attackcell(), check if we have a weapon in our second hand
AND are skilled in twoweaponing
- [+] if so, get an attack with both, but with an accuracy penalty
(until adept level)
- [+] make sure shiedl code doesn't accept weapons!
- [+] knockback() can now knock back other lfs that you hit on the way
* [+] faster resting obs (only via R)
- [+] replace F_RESTING with F_ASLEEP. v0 = onpurpose. if v0, you wake
up when at full hp/mp/etc
- [+] implement F_TRAINING with traincounter
- [+] don't say 'rest until nearby allies ar eheald' if they aren't
damaged
- [+] make listen dififculty check dependant on distance to noise
- [+] doesn't make sense for druid to be a vegetarian. use "can only
eat meat when hungry"
- [+] @@ - combine acc+dmg. ie. "weapon: mace (63%,2-9dmg)
- [+] @@ - show both weapons if dualweilding.
- [+] porcupine shoudl have F_SHARP corpse. implement F_CORPSEFLAGS
- [+] create monster - "giant ant" making "giant antlion"!
- [+] giant porcupine
- [+] implement
- [+] should attack ants on sight - f_hatesrace
- [+] if race=hatesrace or baserace = hatesrace, will attack it.
- [+] gust of wind - blow obs away!
- [+] thorns (grow spikes, attackers take dmg)
- [+] f_retaliate, v0=ndice,v1=dsides, v2=damype, text=obname
- [+] major healing (new spell)
2011-05-05 13:12:52 +10:00
|
|
|
if (hasflag(player->flags, F_ASLEEP)) {
|
2011-03-04 12:22:36 +11:00
|
|
|
// ooo is this right ?
|
|
|
|
needredraw = B_FALSE;
|
* [+] need to set "needredraw" every time we exit:
- [+] make eating take longer - depends on lf size and food sizes
* [+] stop eating if something attacks you!
- [+] change spell code to cope with caster = NULL!!
- [+] why are rooms never more than 2 high
* [+] traps
* [+] eating bug again
* [+] disarm trap skill?
- [+] lots of needredraw bugs
- [+] bug with cursor jumping around lots
- [+] draw darkened visible cells in blue
* [+] shadow cloak
- [+] tree shouldn't prevent resting!
- [+] make plants not attack druids
* [+] cooking
- [+] stop eating if your eating object is no longer with you
* [+] FLAG CORRUPTION BUG
- [+] pet walking back and forth on rotted objects
- [+] purified food shouldn't decay anymore.
- [+] plants shouldn't sleep
- [+] RESTING on statbar not being cleared. the add of f_interrupted
was clearing statdirty before f_asleep got removed in killflag().
- [+] AI: don't eat if in battle
- [+] reduce projectile damage
- [+] show raceclass in statbars
- [+] smoke should make you cough.
- [+] when going up levle, only prompt for spells you can cast?? (don't
show "NOTCASTABLE")
- [+] Your young hawk dies. The stirge releases something!
- [+] sleeping thigns shoudn't follow you up/down stairs.
- [+] when throw'ng an object, don't let it stack (otherwise we might
destroy too much)
- [+] don't draw "c - " for nopickup objects.
- [+] saving throw for traps if you know about it.
- [+] druid - get xp for calming animals
- [+] rogue- get xp for picking locks, disarming traps.
- [+] metal should be immune to most damage types
* [+] make heavy blow need HEAVY weapon, not bashing.
- [+] can't rest/train while levitating!
- [+] gas traps only go off once.
- [+] bug: The goblin throws a boulder at you. A boulder misses you.
- [+] don't give short sword skill to wizard.
- [+] hearing range based on listen skill
* [+] coldness disease:
- [+] CRASH when swapping places
- [+] bug: i can teleport into an impassable object!
- [+] add: "really target (your ally)?"
- [+] give wizards school-based skill instead of manaspike + wildmagic
- [+] LevUp still not being cleared!!!
* [+] why is air wizard being prompted for call lightning at level 2???
* [+] summon weapon (summoning)
- [+] hold portal (mod)
- [+] reveal hidden
- [+] stench (death)
- [+] frostbite (minor but direct cold damage. 1dpower. maxpower 3)
- [+] grease (modific) creates oil in a circle
- [+] fear (death)
- [+] seeinvis (div)
- [+] locate obejct (div) tells you where a seen objcet is.
- [+] swap places (transl) "twiddle"
- [+] fire brand (fire, melee attaks deal fire damage)
- [+] iceedge
- [+] lore (div, temporary knowledge from a particular school?)
- [+] icicle (cold, deals cold dam and knocks enemies away)
* [+] chill (ice, 1d3 damage per exposed body part)
- [+] hail storm (ice, big damage in area)
- [+] wall of ice (creates icy wall, hp based on power)
2011-05-12 11:49:35 +10:00
|
|
|
/*
|
2011-03-16 15:45:46 +11:00
|
|
|
} else if (isdead(who) || cansee(player, who)) {
|
2011-02-01 06:16:13 +11:00
|
|
|
needredraw = B_TRUE;
|
* [+] need to set "needredraw" every time we exit:
- [+] make eating take longer - depends on lf size and food sizes
* [+] stop eating if something attacks you!
- [+] change spell code to cope with caster = NULL!!
- [+] why are rooms never more than 2 high
* [+] traps
* [+] eating bug again
* [+] disarm trap skill?
- [+] lots of needredraw bugs
- [+] bug with cursor jumping around lots
- [+] draw darkened visible cells in blue
* [+] shadow cloak
- [+] tree shouldn't prevent resting!
- [+] make plants not attack druids
* [+] cooking
- [+] stop eating if your eating object is no longer with you
* [+] FLAG CORRUPTION BUG
- [+] pet walking back and forth on rotted objects
- [+] purified food shouldn't decay anymore.
- [+] plants shouldn't sleep
- [+] RESTING on statbar not being cleared. the add of f_interrupted
was clearing statdirty before f_asleep got removed in killflag().
- [+] AI: don't eat if in battle
- [+] reduce projectile damage
- [+] show raceclass in statbars
- [+] smoke should make you cough.
- [+] when going up levle, only prompt for spells you can cast?? (don't
show "NOTCASTABLE")
- [+] Your young hawk dies. The stirge releases something!
- [+] sleeping thigns shoudn't follow you up/down stairs.
- [+] when throw'ng an object, don't let it stack (otherwise we might
destroy too much)
- [+] don't draw "c - " for nopickup objects.
- [+] saving throw for traps if you know about it.
- [+] druid - get xp for calming animals
- [+] rogue- get xp for picking locks, disarming traps.
- [+] metal should be immune to most damage types
* [+] make heavy blow need HEAVY weapon, not bashing.
- [+] can't rest/train while levitating!
- [+] gas traps only go off once.
- [+] bug: The goblin throws a boulder at you. A boulder misses you.
- [+] don't give short sword skill to wizard.
- [+] hearing range based on listen skill
* [+] coldness disease:
- [+] CRASH when swapping places
- [+] bug: i can teleport into an impassable object!
- [+] add: "really target (your ally)?"
- [+] give wizards school-based skill instead of manaspike + wildmagic
- [+] LevUp still not being cleared!!!
* [+] why is air wizard being prompted for call lightning at level 2???
* [+] summon weapon (summoning)
- [+] hold portal (mod)
- [+] reveal hidden
- [+] stench (death)
- [+] frostbite (minor but direct cold damage. 1dpower. maxpower 3)
- [+] grease (modific) creates oil in a circle
- [+] fear (death)
- [+] seeinvis (div)
- [+] locate obejct (div) tells you where a seen objcet is.
- [+] swap places (transl) "twiddle"
- [+] fire brand (fire, melee attaks deal fire damage)
- [+] iceedge
- [+] lore (div, temporary knowledge from a particular school?)
- [+] icicle (cold, deals cold dam and knocks enemies away)
* [+] chill (ice, 1d3 damage per exposed body part)
- [+] hail storm (ice, big damage in area)
- [+] wall of ice (creates icy wall, hp based on power)
2011-05-12 11:49:35 +10:00
|
|
|
*/
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// check for death etc
|
|
|
|
checkdeath();
|
|
|
|
|
|
|
|
//////////////////////////////////
|
|
|
|
// effects which happen every GAME TICK
|
|
|
|
// ie. object hp drain etc
|
|
|
|
//////////////////////////////////
|
|
|
|
|
2011-02-16 05:21:33 +11:00
|
|
|
// note: can't use 'who->' below since 'who' might have died
|
|
|
|
// and been de-alloced during checkdeath() above.
|
|
|
|
timeeffectsworld(player->cell->map); // in case the player changed levels!
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
char *getdirname(int dir) {
|
|
|
|
switch (dir) {
|
|
|
|
case D_N:
|
|
|
|
return "North";
|
|
|
|
case D_E:
|
|
|
|
return "East";
|
|
|
|
case D_S:
|
|
|
|
return "South";
|
|
|
|
case D_W:
|
|
|
|
return "West";
|
2011-02-01 06:16:13 +11:00
|
|
|
case D_UP:
|
|
|
|
return "up";
|
|
|
|
case D_DOWN:
|
|
|
|
return "down";
|
2010-12-02 12:17:54 +11:00
|
|
|
case D_UNKNOWN:
|
|
|
|
return "D_UNKNOWN";
|
|
|
|
case D_NONE:
|
|
|
|
return "D_NONE";
|
2011-03-18 12:25:18 +11:00
|
|
|
case DC_N:
|
|
|
|
return "North";
|
|
|
|
case DC_NE:
|
|
|
|
return "Northeast";
|
|
|
|
case DC_E:
|
|
|
|
return "East";
|
|
|
|
case DC_SE:
|
|
|
|
return "Southeast";
|
|
|
|
case DC_S:
|
|
|
|
return "South";
|
|
|
|
case DC_SW:
|
|
|
|
return "Southwest";
|
|
|
|
case DC_W:
|
|
|
|
return "West";
|
|
|
|
case DC_NW:
|
|
|
|
return "Northwest";
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
return "?errordir?";
|
|
|
|
}
|
|
|
|
|
2011-04-06 17:27:55 +10:00
|
|
|
enum COLOUR getpctcol(float num, float max) {
|
|
|
|
float pct;
|
|
|
|
pct = (num / max) * 100;
|
|
|
|
if (pct > 100) {
|
|
|
|
return C_BOLDBLUE;
|
|
|
|
} else if (pct == 100) {
|
|
|
|
return C_BOLDGREEN;
|
|
|
|
} else if (pct >= 75) {
|
|
|
|
return C_GREEN;
|
|
|
|
} else if (pct >= 50) {
|
|
|
|
return C_BROWN;
|
|
|
|
} else if (pct >= 25) {
|
|
|
|
return C_RED;
|
|
|
|
} else { // ie. < 25%
|
|
|
|
return C_ORANGE;
|
|
|
|
}
|
|
|
|
return C_ORANGE;
|
|
|
|
}
|
|
|
|
|
* [+] 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
|
|
|
void getrarity(int depth, int *min, int *max, int range, int oodok) {
|
2011-02-01 06:16:13 +11:00
|
|
|
int mid;
|
* [+] 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 num;
|
|
|
|
|
|
|
|
// adjust depth for out-of-depth things
|
|
|
|
if (oodok && (onein(6))) {
|
|
|
|
// repeated 1/3 chances of incing level
|
|
|
|
num = rnd(1,6) - 4;
|
|
|
|
while (num > 0) {
|
|
|
|
depth += num;
|
|
|
|
num = rnd(1,6) - 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
mid = 100 - (depth * 3);
|
|
|
|
*min = mid - range; if (*min < 0) *min = 0;
|
2011-03-04 12:22:36 +11:00
|
|
|
//*max = mid + range; if (*max > 100) *max = 100;
|
|
|
|
*max = 100;
|
2011-02-01 06:16:13 +11:00
|
|
|
|
2011-04-14 09:44:29 +10:00
|
|
|
//if (*min > 85) *min = 85;
|
2011-02-01 06:16:13 +11:00
|
|
|
if (*max < 25) *max = 25;
|
|
|
|
}
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
int init(void) {
|
|
|
|
// random numbers
|
|
|
|
srand(time(NULL));
|
|
|
|
|
|
|
|
|
2011-03-18 12:25:18 +11:00
|
|
|
gamemode = GM_INIT;
|
2011-04-01 10:54:44 +11:00
|
|
|
|
|
|
|
playerglyph.ch = '@';
|
|
|
|
playerglyph.colour = C_GREY;
|
|
|
|
tempglyph.ch = '@';
|
|
|
|
tempglyph.colour = C_GREY;
|
2011-03-04 12:22:36 +11:00
|
|
|
|
|
|
|
initcommands();
|
2010-12-02 12:17:54 +11:00
|
|
|
initobjects();
|
2011-03-10 16:47:18 +11:00
|
|
|
initskills();
|
2011-02-01 06:16:13 +11:00
|
|
|
initjobs();
|
2010-12-02 12:17:54 +11:00
|
|
|
initrace();
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
// cell types
|
2011-04-01 10:54:44 +11:00
|
|
|
addcelltype(CT_WALL, "rock wall", '#', C_GREY, B_SOLID, B_OPAQUE, MT_STONE);
|
|
|
|
addcelltype(CT_ROOMWALL, "rock wall", '#', C_GREY, B_SOLID, B_OPAQUE, MT_STONE);
|
|
|
|
addcelltype(CT_CORRIDOR, "rock floor", '.', C_GREY, B_EMPTY, B_TRANS, MT_STONE);
|
|
|
|
addcelltype(CT_LOOPCORRIDOR, "rock floor", 'L', C_GREY, B_EMPTY, B_TRANS, MT_STONE);
|
|
|
|
addcelltype(CT_ROOM, "rock floor", '.', C_GREY, B_EMPTY, B_TRANS, MT_STONE);
|
2011-05-16 12:03:25 +10:00
|
|
|
addcelltype(CT_GRASS, "grass", '.', C_GREEN, B_EMPTY, B_TRANS, MT_PLANT);
|
|
|
|
addcelltype(CT_DIRT, "dirt", '.', C_BROWN, B_EMPTY, B_TRANS, MT_STONE);
|
2011-02-01 06:16:13 +11:00
|
|
|
|
2011-03-18 12:25:18 +11:00
|
|
|
gamemode = GM_VALIDATION;
|
2011-02-01 06:16:13 +11:00
|
|
|
if (validateobs()) {
|
|
|
|
return B_TRUE;
|
|
|
|
}
|
|
|
|
if (validateraces()) {
|
|
|
|
return B_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// open log file
|
|
|
|
logfile = fopen("log.txt","wt");
|
|
|
|
fprintf(logfile, "\n\n\n====== NEW LOGFILE ====\n");
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
return B_FALSE;
|
|
|
|
}
|
|
|
|
|
2011-03-24 16:09:31 +11:00
|
|
|
void calcbresnham(map_t *m, int x1, int y1, int x2, int y2, cell_t **retcell, int *numpixels) {
|
|
|
|
int xinc1,xinc2,yinc1,yinc2,dinc1,dinc2,d;
|
|
|
|
int xinc,yinc,dinc;
|
|
|
|
int i;
|
|
|
|
int x,y;
|
|
|
|
initbresnham( x1, y1, x2, y2, &xinc1, &yinc1, &dinc1, &xinc2, &yinc2, &dinc2, numpixels, &d);
|
|
|
|
x = x1;
|
|
|
|
y = y1;
|
|
|
|
for (i = 0; i < *numpixels; i++) {
|
|
|
|
retcell[i] = getcellat(m, x, y);
|
|
|
|
dobresnham(d, xinc1, yinc1, dinc1, xinc2, yinc2, dinc2, &xinc, &yinc, &dinc);
|
|
|
|
// move to next cell
|
|
|
|
d += dinc;
|
|
|
|
x += xinc;
|
|
|
|
y += yinc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void initbresnham(int x1, int y1, int x2, int y2, int *xinc1, int *yinc1, int *dinc1, int *xinc2, int *yinc2, int *dinc2, int *numpixels, int *d) {
|
|
|
|
int deltax,deltay;
|
|
|
|
|
|
|
|
deltax = (x2 - x1);
|
|
|
|
if (deltax < 0) deltax = -deltax;
|
|
|
|
deltay = (y2 - y1);
|
|
|
|
if (deltay < 0) deltay = -deltay;
|
|
|
|
|
|
|
|
if (deltax >= deltay) {
|
|
|
|
*numpixels = deltax + 1;
|
|
|
|
*d = (deltay*2) - deltax;
|
|
|
|
*dinc1 = deltay << 1;
|
|
|
|
*dinc2 = (deltay-deltax) << 1;
|
|
|
|
*xinc1 = 1;
|
|
|
|
*xinc2 = 1;
|
|
|
|
*yinc1 = 0;
|
|
|
|
*yinc2 = 1;
|
|
|
|
} else {
|
|
|
|
*numpixels = deltay + 1;
|
|
|
|
*d = (deltax*2) - deltay;
|
|
|
|
*dinc1 = deltax << 1;
|
|
|
|
*dinc2 = (deltax - deltay) << 1;
|
|
|
|
*xinc1 = 0;
|
|
|
|
*xinc2 = 1;
|
|
|
|
*yinc1 = 1;
|
|
|
|
*yinc2 = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (x1 > x2) {
|
|
|
|
*xinc1 = - *xinc1;
|
|
|
|
*xinc2 = - *xinc2;
|
|
|
|
}
|
|
|
|
if (y1 > y2) {
|
|
|
|
*yinc1 = - *yinc1;
|
|
|
|
*yinc2 = - *yinc2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-04 12:22:36 +11:00
|
|
|
void initcommands(void) {
|
|
|
|
// Actions
|
|
|
|
addcommand(CMD_UP, '<', "Go up stairs.");
|
|
|
|
addcommand(CMD_DOWN, '>', "Go down stairs, enter a shop/portal.");
|
|
|
|
addcommand(CMD_REST, '.', "Rest once.");
|
|
|
|
addcommand(CMD_PICKUP, ',', "Pick up something from the ground.");
|
|
|
|
addcommand(CMD_CLOSE, 'c', "Close a door.");
|
2011-03-25 12:23:15 +11:00
|
|
|
addcommand(CMD_COMMS, 'C', "Communicate with an ally.");
|
2011-03-04 12:22:36 +11:00
|
|
|
addcommand(CMD_DROP, 'd', "Drop an item.");
|
|
|
|
addcommand(CMD_DROPMULTI, 'D', "Drop multiple items.");
|
|
|
|
addcommand(CMD_EAT, 'e', "Eat something.");
|
2011-03-16 15:45:46 +11:00
|
|
|
addcommand(CMD_EAT, 'E', "Enhance your skills.");
|
2011-03-04 12:22:36 +11:00
|
|
|
addcommand(CMD_MAGIC, 'm', "Use magic or abilities.");
|
2011-03-16 15:45:46 +11:00
|
|
|
addcommand(CMD_MEMMAGIC, 'M', "Memorise a magic shortcut");
|
2011-03-04 12:22:36 +11:00
|
|
|
addcommand(CMD_OPERATE, 'o', "Operate a tool/wand/device.");
|
|
|
|
addcommand(CMD_PICKLOCK, 'p', "Pick a lock.");
|
|
|
|
addcommand(CMD_POUR, 'P', "Pour a potion onto something.");
|
|
|
|
addcommand(CMD_QUAFF, 'q', "Quaff (drink) a potion.");
|
|
|
|
addcommand(CMD_READ, 'r', "Read a scroll/book.");
|
2011-03-16 15:45:46 +11:00
|
|
|
addcommand(CMD_RESTFULL, 'R', "Rest until healed, or train your skills.");
|
2011-03-25 12:23:15 +11:00
|
|
|
addcommand(CMD_THROW, 't', "Throw an object.");
|
2011-03-04 12:22:36 +11:00
|
|
|
addcommand(CMD_TAKEOFF, 'T', "Take off an item of clothing/jewelery.");
|
|
|
|
addcommand(CMD_WEILD, 'w', "Weild a weapon.");
|
|
|
|
addcommand(CMD_WEAR, 'W', "Wear an item of clothing/jewelery.");
|
|
|
|
// Firearms
|
|
|
|
addcommand(CMD_FIRE, 'f', "Fire your firearm/bow at your current target.");
|
|
|
|
addcommand(CMD_FIRENEW, 'F', "Fire your firearm/bow at a new target.");
|
|
|
|
addcommand(CMD_AIM, 'a', "Aim your current firearm/bow at a new target.");
|
|
|
|
// Information
|
|
|
|
addcommand(CMD_HELP, '?', "Display this text.");
|
|
|
|
addcommand(CMD_INFOPLAYER, '@', "Display player stats.");
|
|
|
|
addcommand(CMD_INFOARMOUR, ']', "Display player armour.");
|
|
|
|
addcommand(CMD_FORCEATTACK, 'A', "Force an attack in a given direction.");
|
|
|
|
addcommand(CMD_LOOKHERE, ':', "Look at current cell.");
|
|
|
|
addcommand(CMD_LOOKAROUND, '/', "Look at a remote cell.");
|
|
|
|
addcommand(CMD_INFOKNOWLEDGE, '\\', "Display known items.");
|
|
|
|
addcommand(CMD_MSGHIST, '|', "Display message history.");
|
|
|
|
addcommand(CMD_INV, 'i', "Display your inventory.");
|
|
|
|
// GAME FUNCTIONS
|
|
|
|
addcommand(CMD_QUIT, 'Q', "Quit the game.");
|
|
|
|
addcommand(CMD_SAVEQUIT, 'S', "Save and quit the game.");
|
|
|
|
|
|
|
|
sortcommands();
|
|
|
|
}
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
int isplayerturn(void) {
|
2010-12-07 18:34:26 +11:00
|
|
|
if (!player) return B_FALSE;
|
|
|
|
|
2011-04-08 13:18:54 +10:00
|
|
|
if (isplayer(player->cell->map->lf)) {
|
2010-12-02 12:17:54 +11:00
|
|
|
return B_TRUE;
|
|
|
|
}
|
|
|
|
return B_FALSE;
|
|
|
|
}
|
|
|
|
|
2011-03-04 12:22:36 +11:00
|
|
|
int limit(int *what, int min, int max) {
|
|
|
|
int limited = B_FALSE;
|
* [+] always add webs if there are randomly generated spiders on a level
- [+] non-wood doors
- [+] iron
- [+] only interrupt rest for hunger if it's 'starving' or 'vhungry'
- [+] limit the amount of jumping we can do from athletics skill.
- [+] no message when i lockpick with a -6 combat knife.
- [+] make small corpses give much less nutrition!
- [+] high unarmed skill should give you unarmed attacks with a
1-handed weapon.
- [+] dual weild
- [+] if you have twoweapon skill, when you weild a weapon, say
"weild as secondary weapon? y/n"
- [+] in attackcell(), check if we have a weapon in our second hand
AND are skilled in twoweaponing
- [+] if so, get an attack with both, but with an accuracy penalty
(until adept level)
- [+] make sure shiedl code doesn't accept weapons!
- [+] knockback() can now knock back other lfs that you hit on the way
* [+] faster resting obs (only via R)
- [+] replace F_RESTING with F_ASLEEP. v0 = onpurpose. if v0, you wake
up when at full hp/mp/etc
- [+] implement F_TRAINING with traincounter
- [+] don't say 'rest until nearby allies ar eheald' if they aren't
damaged
- [+] make listen dififculty check dependant on distance to noise
- [+] doesn't make sense for druid to be a vegetarian. use "can only
eat meat when hungry"
- [+] @@ - combine acc+dmg. ie. "weapon: mace (63%,2-9dmg)
- [+] @@ - show both weapons if dualweilding.
- [+] porcupine shoudl have F_SHARP corpse. implement F_CORPSEFLAGS
- [+] create monster - "giant ant" making "giant antlion"!
- [+] giant porcupine
- [+] implement
- [+] should attack ants on sight - f_hatesrace
- [+] if race=hatesrace or baserace = hatesrace, will attack it.
- [+] gust of wind - blow obs away!
- [+] thorns (grow spikes, attackers take dmg)
- [+] f_retaliate, v0=ndice,v1=dsides, v2=damype, text=obname
- [+] major healing (new spell)
2011-05-05 13:12:52 +10:00
|
|
|
if (min != NA) {
|
|
|
|
if (*what < min) {
|
|
|
|
*what = min;
|
|
|
|
limited = B_TRUE;
|
|
|
|
}
|
2011-03-04 12:22:36 +11:00
|
|
|
}
|
* [+] always add webs if there are randomly generated spiders on a level
- [+] non-wood doors
- [+] iron
- [+] only interrupt rest for hunger if it's 'starving' or 'vhungry'
- [+] limit the amount of jumping we can do from athletics skill.
- [+] no message when i lockpick with a -6 combat knife.
- [+] make small corpses give much less nutrition!
- [+] high unarmed skill should give you unarmed attacks with a
1-handed weapon.
- [+] dual weild
- [+] if you have twoweapon skill, when you weild a weapon, say
"weild as secondary weapon? y/n"
- [+] in attackcell(), check if we have a weapon in our second hand
AND are skilled in twoweaponing
- [+] if so, get an attack with both, but with an accuracy penalty
(until adept level)
- [+] make sure shiedl code doesn't accept weapons!
- [+] knockback() can now knock back other lfs that you hit on the way
* [+] faster resting obs (only via R)
- [+] replace F_RESTING with F_ASLEEP. v0 = onpurpose. if v0, you wake
up when at full hp/mp/etc
- [+] implement F_TRAINING with traincounter
- [+] don't say 'rest until nearby allies ar eheald' if they aren't
damaged
- [+] make listen dififculty check dependant on distance to noise
- [+] doesn't make sense for druid to be a vegetarian. use "can only
eat meat when hungry"
- [+] @@ - combine acc+dmg. ie. "weapon: mace (63%,2-9dmg)
- [+] @@ - show both weapons if dualweilding.
- [+] porcupine shoudl have F_SHARP corpse. implement F_CORPSEFLAGS
- [+] create monster - "giant ant" making "giant antlion"!
- [+] giant porcupine
- [+] implement
- [+] should attack ants on sight - f_hatesrace
- [+] if race=hatesrace or baserace = hatesrace, will attack it.
- [+] gust of wind - blow obs away!
- [+] thorns (grow spikes, attackers take dmg)
- [+] f_retaliate, v0=ndice,v1=dsides, v2=damype, text=obname
- [+] major healing (new spell)
2011-05-05 13:12:52 +10:00
|
|
|
if (max != NA) {
|
|
|
|
if (*what > max) {
|
|
|
|
*what = max;
|
|
|
|
limited = B_TRUE;
|
|
|
|
}
|
2011-03-04 12:22:36 +11:00
|
|
|
}
|
|
|
|
return limited;
|
|
|
|
}
|
|
|
|
|
* [+] 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 onein(int howmany) {
|
|
|
|
if (rnd(1,howmany) == 1) return B_TRUE;
|
|
|
|
return B_FALSE;
|
|
|
|
}
|
|
|
|
|
2011-03-24 16:09:31 +11:00
|
|
|
int parseplayerfile(FILE *f, lifeform_t *lf) {
|
|
|
|
// add extra obs etc from f
|
|
|
|
char *pp;
|
|
|
|
char localbuf[BUFLEN];
|
|
|
|
char buf[BUFLEN];
|
|
|
|
int goterror = B_FALSE;
|
|
|
|
fgets(buf, BUFLEN, f);
|
|
|
|
while (!feof(f)) {
|
|
|
|
if (buf[strlen(buf)-1] == '\n') {
|
|
|
|
buf[strlen(buf)-1] = '\0';
|
|
|
|
}
|
|
|
|
//dblog("got line: [%s]",buf);
|
|
|
|
if (strstr(buf, "skill:") == buf) {
|
|
|
|
skill_t *sk;
|
|
|
|
enum SKILLLEVEL slev;
|
|
|
|
strcpy(localbuf, buf + strlen("skill:"));
|
|
|
|
pp = strtok(localbuf, " ");
|
|
|
|
if (!pp) {
|
|
|
|
dblog("ERROR in playerfile. unknown skill level in this line:\n%s\n",buf);
|
|
|
|
goterror = B_TRUE;
|
|
|
|
}
|
|
|
|
slev = findskilllevbyname(pp);
|
|
|
|
|
|
|
|
pp += (strlen(pp) + 1);
|
|
|
|
if (!pp) {
|
|
|
|
dblog("ERROR in playerfile. missing skill name in this line:\n%s\n",buf);
|
|
|
|
goterror = B_TRUE;
|
|
|
|
}
|
|
|
|
sk = findskillbyname(pp);
|
|
|
|
if (sk) {
|
|
|
|
giveskilllev(lf, sk->id, slev);
|
|
|
|
} else {
|
|
|
|
dblog("ERROR in playerfile. unknown skill (%s) in this line:\n%s\n",pp, buf);
|
|
|
|
goterror = B_TRUE;
|
|
|
|
}
|
|
|
|
} else if (strstr(buf, "ob:") == buf) {
|
|
|
|
object_t *o;
|
|
|
|
strcpy(localbuf, buf + strlen("ob:"));
|
|
|
|
o = addob(lf->pack, localbuf);
|
|
|
|
if (o) {
|
|
|
|
identify(o);
|
|
|
|
} else {
|
|
|
|
dblog("ERROR in playerfile. unknown object in this line:\n%s\n",buf);
|
|
|
|
goterror = B_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fgets(buf, BUFLEN, f);
|
|
|
|
}
|
|
|
|
return goterror;
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
float pctof(float pct, float num) {
|
|
|
|
return ((pct / 100.0) * num);
|
|
|
|
}
|
|
|
|
|
2011-04-06 17:27:55 +10:00
|
|
|
|
2010-12-07 18:34:26 +11:00
|
|
|
// get a random number between min and max
|
2010-12-02 12:17:54 +11:00
|
|
|
int rnd(int min, int max) {
|
|
|
|
int res;
|
|
|
|
res = (rand() % (max - min + 1)) + min;
|
|
|
|
return res;
|
|
|
|
}
|
2011-03-22 18:06:28 +11:00
|
|
|
|
|
|
|
|
|
|
|
int roll(char *string) {
|
|
|
|
int ndice,nsides,bonus;
|
|
|
|
int roll;
|
|
|
|
texttodice(string, &ndice,&nsides,&bonus);
|
|
|
|
roll = rolldie(ndice, nsides) + bonus;
|
|
|
|
return roll;
|
|
|
|
}
|
|
|
|
|
2010-12-07 18:34:26 +11:00
|
|
|
// get a random number
|
|
|
|
int rolldie(int ndice, int sides) {
|
|
|
|
int i;
|
|
|
|
int res = 0;
|
|
|
|
for (i = 0; i < ndice; i++) {
|
|
|
|
res += rnd(1,sides);
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
int rollhitdice(lifeform_t *lf) {
|
|
|
|
flag_t *f;
|
|
|
|
int ndice, plus;
|
2011-03-10 16:47:18 +11:00
|
|
|
int roll = 0;
|
|
|
|
int i;
|
|
|
|
float mod;
|
* [+] always add webs if there are randomly generated spiders on a level
- [+] non-wood doors
- [+] iron
- [+] only interrupt rest for hunger if it's 'starving' or 'vhungry'
- [+] limit the amount of jumping we can do from athletics skill.
- [+] no message when i lockpick with a -6 combat knife.
- [+] make small corpses give much less nutrition!
- [+] high unarmed skill should give you unarmed attacks with a
1-handed weapon.
- [+] dual weild
- [+] if you have twoweapon skill, when you weild a weapon, say
"weild as secondary weapon? y/n"
- [+] in attackcell(), check if we have a weapon in our second hand
AND are skilled in twoweaponing
- [+] if so, get an attack with both, but with an accuracy penalty
(until adept level)
- [+] make sure shiedl code doesn't accept weapons!
- [+] knockback() can now knock back other lfs that you hit on the way
* [+] faster resting obs (only via R)
- [+] replace F_RESTING with F_ASLEEP. v0 = onpurpose. if v0, you wake
up when at full hp/mp/etc
- [+] implement F_TRAINING with traincounter
- [+] don't say 'rest until nearby allies ar eheald' if they aren't
damaged
- [+] make listen dififculty check dependant on distance to noise
- [+] doesn't make sense for druid to be a vegetarian. use "can only
eat meat when hungry"
- [+] @@ - combine acc+dmg. ie. "weapon: mace (63%,2-9dmg)
- [+] @@ - show both weapons if dualweilding.
- [+] porcupine shoudl have F_SHARP corpse. implement F_CORPSEFLAGS
- [+] create monster - "giant ant" making "giant antlion"!
- [+] giant porcupine
- [+] implement
- [+] should attack ants on sight - f_hatesrace
- [+] if race=hatesrace or baserace = hatesrace, will attack it.
- [+] gust of wind - blow obs away!
- [+] thorns (grow spikes, attackers take dmg)
- [+] f_retaliate, v0=ndice,v1=dsides, v2=damype, text=obname
- [+] major healing (new spell)
2011-05-05 13:12:52 +10:00
|
|
|
int db = B_FALSE;
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
f = hasflag(lf->flags, F_HITDICE);
|
|
|
|
if (f) {
|
|
|
|
ndice = f->val[0];
|
|
|
|
if (f->val[1] == NA) plus = 0;
|
|
|
|
else plus = f->val[1];
|
|
|
|
} else {
|
|
|
|
ndice = 1;
|
|
|
|
plus = 0;
|
|
|
|
}
|
2011-03-10 16:47:18 +11:00
|
|
|
if (db && isplayer(lf)) dblog("rollhitdice() - rolling %dd4 + %d",ndice,plus);
|
|
|
|
|
|
|
|
mod = getstatmod(lf, A_CON);
|
|
|
|
if (mod > 0) mod *= 2;
|
|
|
|
if (db && isplayer(lf)) dblog("rollhitdice() - mod is +%0.0f%%",mod);
|
|
|
|
|
|
|
|
if (ndice == 0) {
|
|
|
|
int thisroll;
|
|
|
|
// just the bonus
|
|
|
|
thisroll = plus;
|
|
|
|
thisroll = thisroll + (int)((float)thisroll * (mod/100));
|
|
|
|
if (thisroll < 1) thisroll = 1;
|
|
|
|
|
|
|
|
roll += thisroll;
|
|
|
|
} else {
|
|
|
|
for (i = 0; i < ndice; i++) {
|
|
|
|
int thisroll;
|
|
|
|
thisroll = rolldie(1, 4) + plus;
|
|
|
|
if (thisroll < 1) thisroll = 1;
|
|
|
|
if (db && isplayer(lf)) dblog("rollhitdice() ---- die %d/%d == %d",i+1,ndice,thisroll);
|
|
|
|
|
|
|
|
roll += thisroll;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (db && isplayer(lf)) dblog("TOTAL: %d",roll);
|
|
|
|
roll = roll + (int)((float)roll * (mod/100));
|
|
|
|
if (db && isplayer(lf)) dblog(" -> modified to: %d",roll);
|
2011-02-01 06:16:13 +11:00
|
|
|
return roll;
|
|
|
|
}
|
|
|
|
|
|
|
|
int rollmpdice(lifeform_t *lf) {
|
|
|
|
flag_t *f;
|
|
|
|
int ndice, plus;
|
|
|
|
int roll;
|
2011-03-16 15:45:46 +11:00
|
|
|
float mod;
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
f = hasflag(lf->flags, F_MPDICE);
|
|
|
|
if (f) {
|
|
|
|
ndice = f->val[0];
|
|
|
|
if (f->val[1] == NA) plus = 0;
|
|
|
|
else plus = f->val[1];
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
2011-03-16 15:45:46 +11:00
|
|
|
mod = getstatmod(lf, A_IQ);
|
|
|
|
if (mod > 0) mod *= 2;
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
roll = rolldie(ndice, 4) + plus;
|
2011-03-16 15:45:46 +11:00
|
|
|
|
|
|
|
roll = roll + (int)((float)roll * (mod/100));
|
2011-02-01 06:16:13 +11:00
|
|
|
return roll;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2010-12-02 12:17:54 +11:00
|
|
|
void sortlf(map_t *map) {
|
|
|
|
int donesomething;
|
2011-02-01 06:16:13 +11:00
|
|
|
int db = B_FALSE;
|
|
|
|
lifeform_t *l,*nextl;
|
|
|
|
int iter = 0;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
// bubblesort
|
|
|
|
donesomething = B_TRUE;
|
2011-02-01 06:16:13 +11:00
|
|
|
dblog("doing sort...");
|
2010-12-02 12:17:54 +11:00
|
|
|
while (donesomething) {
|
|
|
|
donesomething = B_FALSE;
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
//dblog("ITER %d",iter++);
|
|
|
|
if (db) {
|
|
|
|
dblog("ITER %d",iter++);
|
|
|
|
for (l = map->lf ; l ; l = l->next) {
|
|
|
|
dblog("- %s (timespent= %d) (sorted=%d)", (l == player) ? "player" : l->race->name, l->timespent,l->sorted);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (l = map->lf ; l->next ; l = nextl) {
|
|
|
|
nextl = l->next;
|
|
|
|
//if (!l->sorted && (l->timespent >= l->next->timespent) ) {
|
|
|
|
if (l->sorted) {
|
|
|
|
//dblog("skipping id %d %s, already sorted ",l->id, l->race->name);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (l->timespent >= l->next->timespent) {
|
2010-12-02 12:17:54 +11:00
|
|
|
lifeform_t *temp;
|
2011-02-01 06:16:13 +11:00
|
|
|
//dblog("moving id %d %s upwards",l->id, l->race->name);
|
2010-12-02 12:17:54 +11:00
|
|
|
// remember next element
|
|
|
|
temp = l->next;
|
|
|
|
|
|
|
|
// remove this element from list
|
2011-02-01 06:16:13 +11:00
|
|
|
// don't bother checking if (l->next == NULL) as we know
|
|
|
|
// this won't be true due to the for loop condition
|
2010-12-02 12:17:54 +11:00
|
|
|
if (l->prev == NULL) {
|
|
|
|
// first
|
|
|
|
map->lf = l->next;
|
2011-02-01 06:16:13 +11:00
|
|
|
l->next->prev = NULL;
|
2010-12-02 12:17:54 +11:00
|
|
|
} else {
|
|
|
|
// not first
|
|
|
|
l->prev->next = l->next;
|
2011-02-01 06:16:13 +11:00
|
|
|
l->next->prev = l->prev;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TESTING: re-add at correct position.
|
|
|
|
while (temp->next && (temp->next->timespent <= l->timespent)) {
|
|
|
|
//dblog("moving past %d %s (timespend=%d)...",temp->next->id, temp->next->race->name, temp->next->timespent);
|
|
|
|
temp = temp->next;
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
// re-add element afterwards
|
|
|
|
l->next = temp->next;
|
|
|
|
l->prev = temp;
|
|
|
|
temp->next = l;
|
2011-02-01 06:16:13 +11:00
|
|
|
if (l->next == NULL) {
|
|
|
|
map->lastlf = l;
|
|
|
|
} else {
|
|
|
|
l->next->prev = l;
|
|
|
|
}
|
|
|
|
|
|
|
|
l->sorted = B_TRUE;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
donesomething = B_TRUE;
|
2011-02-01 06:16:13 +11:00
|
|
|
break;
|
2010-12-02 12:17:54 +11:00
|
|
|
} else {
|
|
|
|
l->sorted = B_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
//dblog("finished sort.");
|
|
|
|
|
|
|
|
// reset sorted var for next time
|
|
|
|
for (l = map->lf ; l->next ; l = l->next) {
|
|
|
|
l->sorted = B_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// sanity check
|
|
|
|
if (player->next) {
|
|
|
|
assert(player->next->prev == player);
|
|
|
|
}
|
|
|
|
if (player->prev) {
|
|
|
|
assert(player->prev->next == player);
|
|
|
|
}
|
2010-12-02 12:17:54 +11:00
|
|
|
|
|
|
|
if (db) {
|
|
|
|
dblog("AFTER SORT:");
|
|
|
|
for (l = map->lf ; l ; l = l->next) {
|
2011-02-01 06:16:13 +11:00
|
|
|
// if (haslos(player, l->cell)) {
|
2010-12-07 18:34:26 +11:00
|
|
|
dblog("- %s (timespent= %d) (sorted=%d)", (l == player) ? "player" : l->race->name, l->timespent,l->sorted);
|
2011-02-01 06:16:13 +11:00
|
|
|
// }
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2011-03-04 12:22:36 +11:00
|
|
|
void sortcommands(void) {
|
|
|
|
command_t *c;
|
|
|
|
int donesomething = B_TRUE;
|
|
|
|
while (donesomething) {
|
|
|
|
donesomething = B_FALSE;
|
|
|
|
for (c = firstcommand ; c->next ; c = c->next) {
|
|
|
|
// move up one position if required.
|
|
|
|
if (c->ch > c->next->ch) {
|
|
|
|
command_t *temp;
|
|
|
|
|
|
|
|
// remember next element
|
|
|
|
temp = c->next;
|
|
|
|
|
|
|
|
// remove this element from list
|
|
|
|
if (c->prev == NULL) {
|
|
|
|
// first
|
|
|
|
firstcommand = c->next;
|
|
|
|
c->next->prev = NULL;
|
|
|
|
} else {
|
|
|
|
// not first
|
|
|
|
c->prev->next = c->next;
|
|
|
|
c->next->prev = c->prev;
|
|
|
|
}
|
|
|
|
|
|
|
|
// re-add element afterwards
|
|
|
|
c->next = temp->next;
|
|
|
|
c->prev = temp;
|
|
|
|
temp->next = c;
|
|
|
|
if (c->next == NULL) {
|
|
|
|
lastcommand = c;
|
|
|
|
} else {
|
|
|
|
c->next->prev = c;
|
|
|
|
}
|
|
|
|
|
|
|
|
// mark as done.
|
|
|
|
donesomething = B_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
void timeeffectsworld(map_t *map) {
|
|
|
|
lifeform_t *l;
|
2011-02-16 05:21:33 +11:00
|
|
|
int db = B_FALSE;
|
2011-02-01 06:16:13 +11:00
|
|
|
object_t *o,*nexto;
|
|
|
|
int x,y;
|
|
|
|
long firstlftime;
|
|
|
|
|
2010-12-02 12:17:54 +11:00
|
|
|
// now go through the list and make the first element be 0
|
2011-02-01 06:16:13 +11:00
|
|
|
l = map->lf;
|
|
|
|
|
|
|
|
if (l) {
|
|
|
|
// if (db) dblog("first lf is: %s (id %ld)\n",l->race->name, l->id);
|
|
|
|
firstlftime = l->timespent;
|
|
|
|
assert(firstlftime >= 0);
|
|
|
|
} else {
|
|
|
|
dblog("no lifeforms on map!\n");
|
|
|
|
// no first lf!
|
|
|
|
firstlftime = 0;
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
//if (db) dblog("timespent = %d\n", timespent);
|
2011-02-16 05:21:33 +11:00
|
|
|
if (db) dblog("firstlftime = %d\n", firstlftime);
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
if (firstlftime > 0) {
|
2011-02-16 05:21:33 +11:00
|
|
|
if (db) dblog("making firstlf timespent = 0 (currently %d):", firstlftime);
|
2011-02-01 06:16:13 +11:00
|
|
|
//dumplf();
|
|
|
|
for (l = map->lf ; l ; l = l->next) {
|
|
|
|
//dblog("shuffling id %d %s timespent=%d -> %d",l->id,l->race->name, l->timespent, l->timespent - firstlftime);
|
|
|
|
l->timespent -= firstlftime;
|
|
|
|
assert(l->timespent >= 0);
|
2011-04-06 17:27:55 +10:00
|
|
|
/*
|
2011-02-01 06:16:13 +11:00
|
|
|
if (isplayer(l)) {
|
|
|
|
statdirty = B_TRUE;
|
|
|
|
}
|
2011-04-06 17:27:55 +10:00
|
|
|
*/
|
2011-02-01 06:16:13 +11:00
|
|
|
|
|
|
|
}
|
|
|
|
//dblog("after shuffle:");
|
|
|
|
//dumplf();
|
|
|
|
} else {
|
2011-02-16 05:21:33 +11:00
|
|
|
if (db) dblog("firstlf timespent is not greater than 0. no shuffle.");
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
timeleft += firstlftime;
|
|
|
|
// now do effects based on time...
|
|
|
|
while (timeleft >= TICK_INTERVAL) {
|
|
|
|
|
|
|
|
timeleft -= TICK_INTERVAL;
|
|
|
|
|
|
|
|
// global time-based effects on map or map objects
|
|
|
|
for (y = 0; y < map->h; y++) {
|
|
|
|
for (x = 0; x < map->w; x++) {
|
|
|
|
cell_t *c;
|
|
|
|
c = getcellat(map, x, y);
|
|
|
|
if (c) {
|
|
|
|
// go through each object in the cell...
|
|
|
|
for (o = c->obpile->first ; o ; o = nexto) {
|
|
|
|
nexto = o->next;
|
|
|
|
|
|
|
|
timeeffectsob(o);
|
|
|
|
} // end foreach object here
|
2011-03-10 16:47:18 +11:00
|
|
|
|
|
|
|
// expire light effects
|
|
|
|
if (c->littimer > 0) {
|
|
|
|
c->littimer--;
|
|
|
|
if (c->littimer == 0) {
|
|
|
|
c->lit = c->origlit;
|
|
|
|
}
|
|
|
|
}
|
2011-02-01 06:16:13 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} // end for (y...
|
|
|
|
|
|
|
|
// now handle effects on lifeforms and/or their objects
|
|
|
|
for (l = map->lf ; l ; l = l->next) {
|
|
|
|
timeeffectslf(l);
|
|
|
|
}
|
|
|
|
|
|
|
|
//dblog("AFTER SORT AND ADJUST.....");
|
|
|
|
//dumplf();
|
|
|
|
} // end if timespent
|
|
|
|
|
|
|
|
// inc game time
|
|
|
|
curtime += firstlftime;
|
2010-12-02 12:17:54 +11:00
|
|
|
|
2011-02-01 06:16:13 +11:00
|
|
|
if (db) dblog("cur time is %ld\n",curtime);
|
2010-12-02 12:17:54 +11:00
|
|
|
}
|
2011-03-24 16:09:31 +11:00
|
|
|
|
|
|
|
void usage(char *progname) {
|
|
|
|
printf("usage: %s [ -f playerfile ]\n",progname);
|
|
|
|
printf("\t-f xx\tReads player details from file xx.\n");
|
|
|
|
}
|
|
|
|
|