Skip to content

Commit c0a3263

Browse files
committed
Exclude PC and mechanical party members from party injured count by default
1 parent 86f98b5 commit c0a3263

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

scripts_src/headers/party2.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,37 @@ procedure party_size_humans begin
1313
end
1414

1515
/**
16-
* Returns True if anyone in party is injured, False othewise.
16+
* Returns True if any party **member** (excluding PC) is injured, False othewise.
17+
* @arg {bool} [only_organic=true] include only organic species
1718
* @ret {bool} injured
1819
*/
19-
procedure party_has_injured() begin
20+
procedure party_has_injured(variable only_organic = true) begin
2021
foreach (variable who in party_member_list_critters) begin
22+
if (who == dude_obj) then continue;
23+
if (only_organic) then begin
24+
variable pid;
25+
pid = obj_pid(who);
26+
if (pid == PID_CYBERDOG) or (pid == PID_K9) or (critter_kill_type(who) == KILL_TYPE_robot_kills) then continue;
27+
end
2128
if Is_Injured(who) then return true;
2229
end
2330
return false;
2431
end
2532

2633
/**
27-
* Returns the count of injured party members
34+
* Returns the count of injured party **members** (excluding PC)
35+
* @arg {bool} [only_organic=true] include only organic species
2836
* @ret {int} injured_count
2937
*/
30-
procedure party_injured_count() begin
38+
procedure party_injured_count(variable only_organic = true) begin
3139
variable count = 0;
3240
foreach (variable who in party_member_list_critters) begin
41+
if (who == dude_obj) then continue;
42+
if (only_organic) then begin
43+
variable pid;
44+
pid = obj_pid(who);
45+
if (pid == PID_CYBERDOG) or (pid == PID_K9) or (critter_kill_type(who) == KILL_TYPE_robot_kills) then continue;
46+
end
3347
if Is_Injured(who) then count += 1;
3448
end
3549
return count;

0 commit comments

Comments
 (0)