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/clisp.cpp

    r124 r126  
    127127  l_fields=make_find_symbol("fields");
    128128  l_FIRE=make_find_symbol("FIRE");
    129   l_fire_object=make_find_symbol("fire_object");
    130129  l_fire_object=make_find_symbol("fire_object");
    131130  l_cop_dead_parts=make_find_symbol("cop_dead_parts");  set_symbol_value(l_difficulty,l_hard);
     
    484483  add_c_bool_fun("time_for_next_level",0,0,   293);
    485484  add_c_bool_fun("reset_kills",0,0,           294);
    486   add_c_bool_fun("set_game_name",1,1,         295);  // name
     485  add_c_bool_fun("set_game_name",1,1,         295);  // server game name
    487486  add_c_bool_fun("set_net_min_players",1,1,   296);
     487
     488  add_c_bool_fun("set_object_tint", 1, 1,    1001);  // set_object_tint
     489  add_c_function("get_object_tint", 0, 0,    1002);  // get_object_tint
     490  add_c_bool_fun("set_object_team", 1, 1,    1003);  // set_object_team
     491  add_c_function("get_object_team", 0, 0,    1004);  // get_object_tint
    488492
    489493
     
    23202324        main_net_cfg->min_players=lnumber_value(CAR(args));
    23212325    } break;
    2322 
    2323 
     2326    case 1001: // (set_object_tint)
     2327      if(current_object->Controller)
     2328        current_object->Controller->set_tint(lnumber_value(CAR(args)));
     2329      else
     2330        current_object->set_tint(lnumber_value(CAR(args)));
     2331      break;
     2332    case 1002: //(get_object_tint)
     2333      if(current_object->Controller)
     2334        return current_object->Controller->get_tint();
     2335      else
     2336        return current_object->get_tint();
     2337      break;
     2338    case 1003: //(set_object_team)
     2339      if(current_object->Controller)
     2340        current_object->Controller->set_team(lnumber_value(CAR(args)));
     2341      else
     2342        current_object->set_team(lnumber_value(CAR(args)));
     2343      break;
     2344    case 1004: //(get_object_team)
     2345      if(current_object->Controller)
     2346        return current_object->Controller->get_team();
     2347      else
     2348        return current_object->get_team();
     2349      break;
    23242350    default :
    23252351      printf("Undefined c function %ld\n",number);
Note: See TracChangeset for help on using the changeset viewer.