… | |
… | |
262 | MoveType ACC (RW, move_off); /* Move types affected moving off this space */ |
262 | MoveType ACC (RW, move_off); /* Move types affected moving off this space */ |
263 | MoveType ACC (RW, move_slow); /* Movement types this slows down */ |
263 | MoveType ACC (RW, move_slow); /* Movement types this slows down */ |
264 | |
264 | |
265 | // 8 free bits |
265 | // 8 free bits |
266 | |
266 | |
267 | float ACC (RW, expmul); /* needed experience = (calc_exp*expmul) - means some */ |
267 | //float ACC (RW, expmul) = 1.0; /* needed experience = (calc_exp*expmul) - means some */ |
268 | /* races/classes can need less/more exp to gain levels */ |
268 | // /* races/classes can need less/more exp to gain levels */ |
|
|
269 | static const float expmul = 1.0;//D |
269 | float ACC (RW, move_slow_penalty); /* How much this slows down the object */ |
270 | float ACC (RW, move_slow_penalty); /* How much this slows down the object */ |
270 | |
271 | |
271 | /* Following are values used by any object */ |
272 | /* Following are values used by any object */ |
272 | /* this objects turns into or what this object creates */ |
273 | /* this objects turns into or what this object creates */ |
273 | treasurelist *ACC (RW, randomitems); /* Items to be generated */ |
274 | treasurelist *ACC (RW, randomitems); /* Items to be generated */ |
… | |
… | |
532 | |
533 | |
533 | return op; |
534 | return op; |
534 | } |
535 | } |
535 | |
536 | |
536 | // returns the outermost environment, never returns 0 |
537 | // returns the outermost environment, never returns 0 |
537 | MTH object *outer_env () const |
538 | MTH object *outer_env_or_self () const |
538 | { |
539 | { |
539 | const object *op; |
540 | const object *op; |
540 | |
541 | |
541 | for (op = this; op->env; op = op->env) |
542 | for (op = this; op->env; op = op->env) |
542 | ; |
543 | ; |
543 | |
544 | |
544 | return const_cast<object *>(op); |
545 | return const_cast<object *>(op); |
|
|
546 | } |
|
|
547 | |
|
|
548 | // returns the outermost environment, may return 0 |
|
|
549 | MTH object *outer_env () const |
|
|
550 | { |
|
|
551 | return env ? outer_env () : 0; |
545 | } |
552 | } |
546 | |
553 | |
547 | // returns the player that has this object in his inventory, or 0 |
554 | // returns the player that has this object in his inventory, or 0 |
548 | // we assume the player is always the outer env |
555 | // we assume the player is always the outer env |
549 | MTH object *in_player () const |
556 | MTH object *in_player () const |
550 | { |
557 | { |
551 | object *op = outer_env (); |
558 | object *op = outer_env_or_self (); |
552 | |
559 | |
553 | return op->type == PLAYER ? op : 0; |
560 | return op->type == PLAYER ? op : 0; |
554 | } |
561 | } |
555 | |
562 | |
556 | // "temporary" helper function |
563 | // "temporary" helper function |