Ignore:
Timestamp:
Mar 18, 2008, 11:22:51 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Implement game_object::set_tint, get_tint, set_team and get_team, as well as the corresponding set_object_tint, get_object_tint, set_object_team and get_object_team LISP functions. They'll be useful for CTF mode.

Inspired by Abuse Win32 changelog from February 18, 2001:

  • Changed lisp function (set_player_color x) to

(set_object_tint x)

  • Added lisp function (get_object_tint)

Inspired by Abuse Win32 changelog from February 17, 2001:

  • Added lisp function (set_player_color x) to switch player

to color number x
see chat.lsp for details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/objects.cpp

    r124 r126  
    442442}
    443443
    444 int game_object::can_hurt(game_object *who)     // collision checking will ask first to see if you
    445 {
    446   int is_attacker=current_level->is_attacker(this);
    447   // it's you against them!  Damage only if it you are attacking or they are attacking you
    448   // I.E. don't let them hurt themselves, this can change if you over-ride this virtual function
    449 
    450   if (who->hurtable() && (is_attacker || current_level->is_attacker(who) || hurt_all()))
    451     return 1;
    452   else return 0;
     444// collision checking will ask first to see if you
     445int game_object::can_hurt(game_object *who)
     446{
     447    int is_attacker = current_level->is_attacker(this);
     448
     449    // it's you against them!  Damage only if it you are attacking or they are
     450    // attacking you, ie. don't let them hurt themselves. This can change if
     451    // you override this virtual function
     452
     453    if(who->hurtable()
     454        && ((_team == -1) || (_team != who->get_team()))
     455        && (is_attacker || current_level->is_attacker(who) || hurt_all()))
     456        return 1;
     457
     458    return 0;
    453459}
    454460
    455461void game_object::note_attack(game_object *whom)
    456462{
    457   return ;  // nevermind
     463    return; // nevermind
    458464}
    459465
     
    470476                int32_t push_xvel, int32_t push_yvel)
    471477{
     478  // No friendly fire
     479  if((_team != -1) && (_team == from->get_team()))
     480    return;
    472481
    473482  void *d=figures[otype]->get_fun(OFUN_DAMAGE);
Note: See TracChangeset for help on using the changeset viewer.