mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Updated NPC combat control mod to prevent Marcus and non-biped critters from equipping armor when controlled by the player.
This commit is contained in:
Binary file not shown.
@@ -46,7 +46,7 @@ procedure combatturn_handler begin
|
||||
if inControl then begin
|
||||
// center the screen on the controlled critter and remove roof tiles
|
||||
move_to(dude_obj, dude_tile, dude_elevation);
|
||||
if displayName then begin
|
||||
if (displayName and critter != real_dude_obj) then begin
|
||||
set_iface_tag_text(displayName, obj_name(critter), displayNameColor);
|
||||
show_iface_tag(displayName);
|
||||
end
|
||||
@@ -62,8 +62,17 @@ procedure gamemodechange_handler begin
|
||||
if not(get_game_mode BWAND COMBAT) then inControl := false;
|
||||
end
|
||||
|
||||
procedure inventorymove_handler begin
|
||||
if (inControl and get_sfall_arg == 3) then begin // armor slot
|
||||
if (obj_pid(dude_obj) == PID_MARCUS or proto_data(obj_pid(dude_obj), cr_body_type) != CR_BODY_BIPED) then begin
|
||||
display_msg(message_str_game(GAME_MSG_PROTO, 675));
|
||||
set_sfall_return(true);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
procedure start begin
|
||||
if game_loaded and (sfall_ver_major >= 4) then begin
|
||||
if (game_loaded and sfall_ver_major >= 4) then begin
|
||||
set_perk_ranks(PERK_gecko_skinning_perk, 1);
|
||||
set_perk_level(PERK_gecko_skinning_perk, 999); // prevent it from appearing in the perk selection window
|
||||
controlMode := GetConfig("CombatControl", "Mode", 0);
|
||||
@@ -79,6 +88,7 @@ procedure start begin
|
||||
|
||||
register_hook_proc(HOOK_COMBATTURN, combatturn_handler);
|
||||
register_hook_proc(HOOK_GAMEMODECHANGE, gamemodechange_handler);
|
||||
register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user