mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added PerksList option to gl_partycontrol
This commit is contained in:
@@ -39,6 +39,9 @@ MotionScanner=0
|
|||||||
Mode=0
|
Mode=0
|
||||||
;PIDList=62,89,97,107,160,161
|
;PIDList=62,89,97,107,160,161
|
||||||
|
|
||||||
|
;Set a comma delimited list of perk IDs for perks to be inherited from the player during the combat control
|
||||||
|
PerksList=0,73
|
||||||
|
|
||||||
;Choose a notification box to display the name of the controlled critter above the interface bar
|
;Choose a notification box to display the name of the controlled critter above the interface bar
|
||||||
;Must be between 5 and (4 + the value of BoxBarCount in ddraw.ini)
|
;Must be between 5 and (4 + the value of BoxBarCount in ddraw.ini)
|
||||||
;For sfall 4.1.6+ the number for the notification box is set automatically, so just use any value
|
;For sfall 4.1.6+ the number for the notification box is set automatically, so just use any value
|
||||||
|
|||||||
Binary file not shown.
@@ -21,11 +21,10 @@
|
|||||||
variable
|
variable
|
||||||
controlMode,
|
controlMode,
|
||||||
noCheckArray,
|
noCheckArray,
|
||||||
pidList,
|
pidList, perksList,
|
||||||
lightInt, lightDist, npcControl,
|
lightInt, lightDist, npcControl,
|
||||||
displayName, displayNameColor, isShowTag,
|
displayName, displayNameColor, isShowTag,
|
||||||
inControl := false,
|
inControl := false;
|
||||||
hasGeckoSkinning := false;
|
|
||||||
|
|
||||||
|
|
||||||
procedure AllowControl(variable pid) begin
|
procedure AllowControl(variable pid) begin
|
||||||
@@ -37,10 +36,9 @@ procedure combatturn_handler begin
|
|||||||
variable
|
variable
|
||||||
status := get_sfall_arg,
|
status := get_sfall_arg,
|
||||||
critter := get_sfall_arg,
|
critter := get_sfall_arg,
|
||||||
//arg3 := get_sfall_arg,
|
pid, perkID, level;
|
||||||
pid;
|
|
||||||
|
|
||||||
//display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + ", arg3: " + arg3);
|
//display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + ", arg3: " + get_sfall_arg);
|
||||||
if npcControl then begin
|
if npcControl then begin
|
||||||
if lightInt then lightInt := round((lightInt / 65536.0) * 100); // calc percent of intensity
|
if lightInt then lightInt := round((lightInt / 65536.0) * 100); // calc percent of intensity
|
||||||
obj_set_light_level(npcControl, lightInt, lightDist); // restore light for prev. controlled NPC
|
obj_set_light_level(npcControl, lightInt, lightDist); // restore light for prev. controlled NPC
|
||||||
@@ -49,14 +47,20 @@ procedure combatturn_handler begin
|
|||||||
pid := obj_pid(critter);
|
pid := obj_pid(critter);
|
||||||
if (status == 1 and (AllowControl(pid) or controlMode == 1)) then begin
|
if (status == 1 and (AllowControl(pid) or controlMode == 1)) then begin
|
||||||
set_dude_obj(critter);
|
set_dude_obj(critter);
|
||||||
|
//display_msg("Take control of: " + obj_name(critter));
|
||||||
if (critter != real_dude_obj) then begin
|
if (critter != real_dude_obj) then begin
|
||||||
if not(npcControl) then obj_set_light_level(real_dude_obj, 0, 0); // dude off light
|
if not(npcControl) then obj_set_light_level(real_dude_obj, 0, 0); // dude off light
|
||||||
npcControl := critter;
|
npcControl := critter;
|
||||||
|
// set perks (only work with 4.1.8+)
|
||||||
|
foreach (perkID in perksList) begin
|
||||||
|
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
|
||||||
|
if (level) then begin
|
||||||
|
critter_add_trait(critter, TRAIT_PERK, perkID, level);
|
||||||
|
end
|
||||||
|
end
|
||||||
lightDist := get_object_data(critter, OBJ_DATA_LIGHT_DISTANCE);
|
lightDist := get_object_data(critter, OBJ_DATA_LIGHT_DISTANCE);
|
||||||
lightInt := get_object_data(critter, OBJ_DATA_LIGHT_INTENSITY);
|
lightInt := get_object_data(critter, OBJ_DATA_LIGHT_INTENSITY);
|
||||||
obj_set_light_level(critter, 100, 4);
|
obj_set_light_level(critter, 100, 4);
|
||||||
|
|
||||||
if hasGeckoSkinning then critter_add_trait(critter, TRAIT_PERK, PERK_gecko_skinning_perk, 1);
|
|
||||||
inControl := true;
|
inControl := true;
|
||||||
end else if npcControl then begin
|
end else if npcControl then begin
|
||||||
obj_set_light_level(dude_obj, 100, 4); // set dude default light
|
obj_set_light_level(dude_obj, 100, 4); // set dude default light
|
||||||
@@ -87,7 +91,6 @@ procedure combatturn_handler begin
|
|||||||
end
|
end
|
||||||
|
|
||||||
procedure gamemodechange_handler begin
|
procedure gamemodechange_handler begin
|
||||||
if not(hasGeckoSkinning) then hasGeckoSkinning := has_trait(TRAIT_PERK, real_dude_obj, PERK_gecko_skinning_perk);
|
|
||||||
if (inControl and not(get_game_mode BWAND COMBAT)) then begin
|
if (inControl and not(get_game_mode BWAND COMBAT)) then begin
|
||||||
inControl := false;
|
inControl := false;
|
||||||
npcControl := 0;
|
npcControl := 0;
|
||||||
@@ -146,6 +149,9 @@ procedure start begin
|
|||||||
fix_array(pidList);
|
fix_array(pidList);
|
||||||
noCheckArray := (len_array(pidList) == 0);
|
noCheckArray := (len_array(pidList) == 0);
|
||||||
|
|
||||||
|
perksList := GetConfigListInt("CombatControl", "PerksList");
|
||||||
|
fix_array(perksList);
|
||||||
|
|
||||||
register_hook_proc(HOOK_COMBATTURN, combatturn_handler);
|
register_hook_proc(HOOK_COMBATTURN, combatturn_handler);
|
||||||
register_hook_proc(HOOK_GAMEMODECHANGE, gamemodechange_handler);
|
register_hook_proc(HOOK_GAMEMODECHANGE, gamemodechange_handler);
|
||||||
register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler);
|
register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler);
|
||||||
|
|||||||
Reference in New Issue
Block a user