-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa8ca25
commit d75af9d
Showing
24 changed files
with
54 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
|
||
tackle_min = 4 | ||
tackle_max = 5 | ||
tackle_chance = 40 | ||
tacklestrength_min = 4 | ||
tacklestrength_max = 4 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
max_build_dist = 1 | ||
|
||
tackle_min = 4 | ||
tackle_max = 5 | ||
tackle_max = 6 | ||
|
||
aura_strength = 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 19 additions & 6 deletions
25
code/modules/mob/living/carbon/xenomorph/xeno_tackle_counter.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
/datum/tackle_counter | ||
var/mob/living/carbon/human/tackled_mob | ||
var/tackle_count = 0 | ||
var/min_tackles | ||
var/max_tackles | ||
var/tackle_chance | ||
var/tackle_reset_id | ||
|
||
/datum/tackle_counter/New(min, max, chance) | ||
/datum/tackle_counter/New(mob/living/carbon/human/tackle_mob, min, max) | ||
tackled_mob = tackle_mob | ||
min_tackles = min | ||
max_tackles = max | ||
tackle_chance = chance | ||
|
||
/datum/tackle_counter/proc/attempt_tackle(tackle_bonus = 0) | ||
#define TACKLE_HEALTH_CONSIDERATION_CAP 20 | ||
#define TACKLE_DAMAGE_CONSIDERATION_MAX 80 | ||
|
||
/datum/tackle_counter/proc/attempt_tackle() | ||
tackle_count++ | ||
|
||
if (tackle_count >= max_tackles) | ||
return TRUE | ||
else if (tackle_count < min_tackles) | ||
|
||
if (tackle_count < min_tackles) | ||
return FALSE | ||
else if (prob(tackle_chance + tackle_bonus)) | ||
|
||
var/tackle_mob_damage = 100 - max(tackled_mob.health, TACKLE_HEALTH_CONSIDERATION_CAP) | ||
var/tackle_tier_cut_offs = TACKLE_DAMAGE_CONSIDERATION_MAX / (max_tackles - min_tackles) | ||
var/tackle_tier_diff = tackle_mob_damage / tackle_tier_cut_offs | ||
var/tackles_required = max_tackles - tackle_tier_diff | ||
|
||
if(tackle_count >= tackles_required) | ||
return TRUE | ||
|
||
return FALSE | ||
|
||
#undef TACKLE_HEALTH_CONSIDERATION_CAP | ||
#undef TACKLE_DAMAGE_CONSIDERATION_MAX |