Skip to content

Commit

Permalink
anti c4 gamemode flag, anti drag flag fix (#7459)
Browse files Browse the repository at this point in the history
# About the pull request

adds togglable flag that prevents c4s to be planeted on humans when it
is on gamemode. fixes bipasses of anti drag

# Explain why it's good for the game

c4ing bodies of other side SUCKS and is hated by every side, if you want
it for zombies, go ahead I place it on HvH. draging with roller beds and
bodybags is not intended and a bug


# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: toggleble flag to prevent c4s on human for gamemodes
fix: anti stripmode flag prevents buckling to roller beds and closing
into bags to move dead or crit bodies of enemy faction
/:cl:

---------

Co-authored-by: vincibrv <[email protected]>
  • Loading branch information
cuberound and uuuuhuuuu authored Dec 16, 2024
1 parent 9e2549c commit 95f3eda
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 18 deletions.
2 changes: 1 addition & 1 deletion code/game/gamemodes/extended/cm_vs_upp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "Faction Clash UPP CM"
config_tag = "Faction Clash UPP CM"
flags_round_type = MODE_THUNDERSTORM|MODE_FACTION_CLASH
starting_round_modifiers = list(/datum/gamemode_modifier/blood_optimization, /datum/gamemode_modifier/defib_past_armor, /datum/gamemode_modifier/disable_combat_cas, /datum/gamemode_modifier/disable_ib, /datum/gamemode_modifier/disable_attacking_corpses, /datum/gamemode_modifier/disable_long_range_sentry, /datum/gamemode_modifier/disable_stripdrag_enemy, /datum/gamemode_modifier/indestructible_splints, /datum/gamemode_modifier/mortar_laser_warning)
starting_round_modifiers = list(/datum/gamemode_modifier/blood_optimization, /datum/gamemode_modifier/defib_past_armor, /datum/gamemode_modifier/disable_combat_cas, /datum/gamemode_modifier/disable_ib, /datum/gamemode_modifier/disable_attacking_corpses, /datum/gamemode_modifier/disable_long_range_sentry, /datum/gamemode_modifier/disable_stripdrag_enemy, /datum/gamemode_modifier/indestructible_splints, /datum/gamemode_modifier/mortar_laser_warning, /datum/gamemode_modifier/no_body_c4)
taskbar_icon = 'icons/taskbar/gml_hvh.png'

/datum/game_mode/extended/faction_clash/cm_vs_upp/get_roles_list()
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/extended/extended_clash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "Faction Clash"
config_tag = "Faction Clash"
flags_round_type = MODE_THUNDERSTORM|MODE_FACTION_CLASH
starting_round_modifiers = list(/datum/gamemode_modifier/blood_optimization, /datum/gamemode_modifier/defib_past_armor, /datum/gamemode_modifier/disable_combat_cas, /datum/gamemode_modifier/disable_long_range_sentry, /datum/gamemode_modifier/disable_stripdrag_enemy, /datum/gamemode_modifier/indestructible_splints, /datum/gamemode_modifier/mortar_laser_warning)
starting_round_modifiers = list(/datum/gamemode_modifier/blood_optimization, /datum/gamemode_modifier/defib_past_armor, /datum/gamemode_modifier/disable_combat_cas, /datum/gamemode_modifier/disable_ib, /datum/gamemode_modifier/disable_attacking_corpses, /datum/gamemode_modifier/disable_long_range_sentry, /datum/gamemode_modifier/disable_stripdrag_enemy, /datum/gamemode_modifier/indestructible_splints, /datum/gamemode_modifier/mortar_laser_warning, /datum/gamemode_modifier/no_body_c4)

/datum/game_mode/extended/faction_clash/get_roles_list()
return GLOB.ROLES_FACTION_CLASH
Expand Down
4 changes: 4 additions & 0 deletions code/game/gamemodes/round_modifiers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,7 @@
/datum/gamemode_modifier/yautja_shipside_large_sd
modifier_name = "Yautja Shipside Large SD"
modifier_desc = "Allows Yautja to large self destruct on the mainship z-level."

/datum/gamemode_modifier/no_body_c4
modifier_name = "No body c4"
modifier_desc = "Prevents c4 explosives from being planted on dead body."
3 changes: 3 additions & 0 deletions code/game/objects/items/explosives/plastic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@
return FALSE

if(ishuman(target))
if(SSticker.mode && MODE_HAS_MODIFIER(/datum/gamemode_modifier/no_body_c4))
to_chat(user, SPAN_WARNING("This feels wrong, you do not want to do it."))
return FALSE
var/mob/living/carbon/human/H = target
if(user.faction == H.faction)
to_chat(user, SPAN_WARNING("ARE YOU OUT OF YOUR MIND?!"))
Expand Down
16 changes: 10 additions & 6 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@
return 0
return 1

/obj/structure/closet/proc/can_close()
/obj/structure/closet/proc/can_close(mob/user)
for(var/obj/structure/closet/closet in get_turf(src))
if(closet != src && !closet.wall_mounted)
return 0
return FALSE
for(var/mob/living/carbon/xenomorph/xeno in get_turf(src))
return 0
return 1
return FALSE
if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy))
for(var/mob/living/carbon/human/closed_mob in get_turf(src))
if((closed_mob.stat == DEAD || closed_mob.health < HEALTH_THRESHOLD_CRIT) && !closed_mob.get_target_lock(user.faction_group) && !(closed_mob.status_flags & PERMANENTLY_DEAD)&& !(closed_mob.status_flags & PERMANENTLY_DEAD))
return FALSE
return TRUE

/obj/structure/closet/proc/dump_contents()

Expand Down Expand Up @@ -102,10 +106,10 @@
density = FALSE
return 1

/obj/structure/closet/proc/close()
/obj/structure/closet/proc/close(mob/user)
if(!src.opened)
return 0
if(!src.can_close())
if(!src.can_close(user))
return 0

var/stored_units = 0
Expand Down
8 changes: 6 additions & 2 deletions code/game/objects/structures/stool_bed_chair_nest/bed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,15 @@
. = ..()

//Trying to buckle a mob
/obj/structure/bed/buckle_mob(mob/M, mob/user)
/obj/structure/bed/buckle_mob(mob/living/carbon/human/mob, mob/user)
if(buckled_bodybag)
return
if(ishuman(mob))
if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (mob.stat == DEAD || mob.health < HEALTH_THRESHOLD_CRIT) && !mob.get_target_lock(user.faction_group) && !(mob.status_flags & PERMANENTLY_DEAD))
to_chat(user, SPAN_WARNING("You can't buckle a crit or dead member of another faction! ."))
return FALSE
..()
if(M.loc == src.loc && buckling_sound && M.buckled)
if(mob.loc == src.loc && buckling_sound && mob.buckled)
playsound(src, buckling_sound, 20)

/obj/structure/bed/Move(NewLoc, direct)
Expand Down
16 changes: 8 additions & 8 deletions code/modules/mob/living/carbon/human/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@
if(W.isOn())
W.toggle()
goes_out++
for(var/obj/item/tool/match/M in contents)
M.burn_out(src)
for(var/obj/item/tool/match/mob in contents)
mob.burn_out(src)
for(var/obj/item/tool/lighter/Z in contents)
if(Z.turn_off(src))
goes_out++
Expand Down Expand Up @@ -414,13 +414,13 @@
/mob/living/carbon/human/proc/has_item_in_ears(item)
return (item == wear_l_ear) || (item == wear_r_ear)

/mob/living/carbon/human/can_be_pulled_by(mob/M)
/mob/living/carbon/human/can_be_pulled_by(mob/mob)
var/ignores_stripdrag_flag = FALSE
if(ishuman(M))
var/mob/living/carbon/human/H = M
ignores_stripdrag_flag = H.species.ignores_stripdrag_flag
if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && !ignores_stripdrag_flag && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(M.faction_group))
to_chat(M, SPAN_WARNING("You can't pull a crit or dead member of another faction!"))
if(ishuman(mob))
var/mob/living/carbon/human/human = mob
ignores_stripdrag_flag = human.species.ignores_stripdrag_flag
if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && !ignores_stripdrag_flag && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(mob.faction_group) && !(mob.status_flags & PERMANENTLY_DEAD))
to_chat(mob, SPAN_WARNING("You can't pull a crit or dead member of another faction!"))
return FALSE
return TRUE

Expand Down

0 comments on commit 95f3eda

Please sign in to comment.