View Single Post
Old January 29, 2019, 10:16   #14
tangar
Knight
 
tangar's Avatar
 
Join Date: Mar 2015
Location: Moscow, Russia
Posts: 550
tangar is on a distinguished road
Today this silly newbie (I am) tried to customized the hunger state from traps.. To create my own trap.

Quote:
# hunger

name:trap:hunger trap
graphics:^:light yellow
appear:1:10:0
visibility:d50
flags:TRAP | FLOOR | MAGICAL | ONETIME
effect:SET_NOURISH
dice:$B
expr:B:FOOD_FAINT:- 1
desc:A trap that makes you very hungry.
msg:You feel yourself very hungry!
But. I wanna make trap less severe. I've looked with my wide blank eye @ source code and found some staff

player-common.h
Quote:
#define PY_FOOD_MAX 17000 /* Food value (Bloated) */
#define PY_FOOD_FULL 10000 /* Food value (Normal) */
#define PY_FOOD_ALERT 2000 /* Food value (Hungry) */
#define PY_FOOD_WEAK 1000 /* Food value (Weak) */
#define PY_FOOD_FAINT 500 /* Food value (Fainting) */
#define PY_FOOD_STARVE 100 /* Food value (Starving) */
player-timed.c
Quote:
if (v < PY_FOOD_FAINT) new_aux = 0;
else if (v < PY_FOOD_WEAK) new_aux = 1;
else if (v < PY_FOOD_ALERT) new_aux = 2;
else if (v < PY_FOOD_FULL) new_aux = 3;
else new_aux = 4;
Then I've started experimentation with trap effect..

effect:SET_NOURISH
dice:$B
expr:B:FOOD_FAINT:- 1

I've tried loads of different effects like:
expr:B:FOOD_WEAK:- 1
expr:B:FOOD_ALERT:- 1
...
even to exotic ones (good example when you do something which you have no clue):
expr:B:FOOD_FAINT:+ 1

..

Then I recognized that this could be a boolean

Damm. Then I've tried to use:

effect:NOURISH

with '-' value.. like:
effect:NOURISH
dice:-4000

it didn't work.

/rfe
Would be fun to have some customization on hunger state
. At the same time maybe someone could advice me certain trick, maybe it's possible to do it in current version?

Thanks!
__________________
http://tangaria.com - persistent online multiplayer roguelike game
tangar.info - my website ⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽ My chars @ angband.oook.cz
youtube.com/GlazGame — streams in English ⍽ youtube.com/StreamGuild — streams in Russian

Last edited by tangar; January 29, 2019 at 10:50.
tangar is online now   Reply With Quote