Skip to content

Commit

Permalink
add: new shoves impact + brand intelligence tweaks (#5608) [testmerge]
Browse files Browse the repository at this point in the history
commit 00d8da2
Merge: 682dadb 5189da6
Author: Aziz Chynaliev <[email protected]>
Date:   Sat Aug 31 19:21:24 2024 +0600

    Merge branch 'master220' into shove_impacts

commit 682dadb
Merge: e4dfd41 59b2a65
Author: NightDawnFox <[email protected]>
Date:   Sun Aug 25 12:26:41 2024 +0500

    Merge remote-tracking branch 'upstream/master220' into shove_impacts

commit e4dfd41
Merge: 3f9c6b3 45f8323
Author: NightDawnFox <[email protected]>
Date:   Sun Aug 25 12:18:04 2024 +0500

    Merge remote-tracking branch 'upstream/master220' into shove_impacts

commit 3f9c6b3
Author: NightDawnFox <[email protected]>
Date:   Thu Aug 15 10:34:52 2024 +0500

    упс

commit 8256edc
Author: NightDawnFox <[email protected]>
Date:   Thu Aug 15 10:33:32 2024 +0500

    В свое оправдание скажу, что я лениво скопирнул..

commit 531b091
Author: NightDawnFox <[email protected]>
Date:   Sun Aug 4 16:30:40 2024 +0500

    совместимость с новым кодом звея вроде бы

commit b9ae358
Merge: a46cbe5 f10796f
Author: NightDawnFox <[email protected]>
Date:   Sun Aug 4 16:26:33 2024 +0500

    Merge remote-tracking branch 'upstream/master220' into shove_impacts

commit a46cbe5
Author: NightDawnFox <[email protected]>
Date:   Sun Aug 4 15:50:57 2024 +0500

    буквы читать скучно(

commit 8308688
Author: NightDawnFox <[email protected]>
Date:   Fri Aug 2 12:09:14 2024 +0500

    фиксы по требованию звея

commit 8b29f49
Merge: 44333e7 daa9ed4
Author: NightDawnFox <[email protected]>
Date:   Fri Aug 2 12:02:13 2024 +0500

    Merge remote-tracking branch 'upstream/master220' into shove_impacts

commit 44333e7
Author: NightDawnFox <[email protected]>
Date:   Mon Jul 29 16:33:55 2024 +0500

    выловленный рантайм

commit 8fdf480
Author: NightDawnFox <[email protected]>
Date:   Mon Jul 29 16:08:56 2024 +0500

    блядь

commit 9266789
Merge: 7902ede c2f0479
Author: NightDawnFox <[email protected]>
Date:   Mon Jul 29 16:06:14 2024 +0500

    Merge remote-tracking branch 'upstream/master220' into shove_impacts

commit 7902ede
Author: NightDawnFox <[email protected]>
Date:   Mon Jul 29 15:41:48 2024 +0500

    паайдет

commit dec2c32
Author: NightDawnFox <[email protected]>
Date:   Fri Jul 19 18:34:11 2024 +0500

    temp
  • Loading branch information
Bizzonium committed Aug 31, 2024
1 parent 1071f87 commit fd0f45f
Show file tree
Hide file tree
Showing 16 changed files with 645 additions and 3 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_IGNOREDAMAGESLOWDOWN "ignoredamageslowdown"
#define TRAIT_STRONG_GRABBER "strong_grabber"
#define TRAIT_PUSHIMMUNE "push_immunity"
#define TRAIT_FLATTENED "flattened"

/// Not a genetic obesity but just a mob who overate
#define TRAIT_FAT "trait_fat"
#define TRAIT_HUSK "husk"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,5 @@
#define EVIL_FAX_TRAIT "evil_fax"
#define CORGI_HARDSUIT_TRAIT "corgi_hardsuit"

#define VENDOR_FLATTENING_TRAIT "vendor_flattening"

1 change: 1 addition & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_EXOTIC_BLOOD" = TRAIT_EXOTIC_BLOOD,
"TRAIT_FAKEDEATH" = TRAIT_FAKEDEATH,
"TRAIT_FAT" = TRAIT_FAT,
"TRAIT_FLATTENED" = TRAIT_FLATTENED,
"TRAIT_FLOORED" = TRAIT_FLOORED,
"TRAIT_FORCE_DOORS" = TRAIT_FORCE_DOORS,
"TRAIT_FORCED_GRAVITY" = TRAIT_FORCED_GRAVITY,
Expand Down
64 changes: 64 additions & 0 deletions code/datums/elements/squish.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#define SHORT_SCALE (5/7)
#define TALL_SCALE (7/5)

/**
* squish.dm
*
* It's an element that squishes things. After the duration passes, it reverses the transformation it squished with, taking into account if they are a different orientation than they started (read: rotationally-fluid)
*
* Normal squishes apply vertically, as if the target is being squished from above, but you can set reverse to TRUE if you want to squish them from the sides, like if they pancake into a wall from the East or West
*/

/datum/element/squish
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY

/datum/element/squish/Attach(datum/target, duration = 20 SECONDS, reverse = FALSE)
. = ..()
if(!iscarbon(target))
return ELEMENT_INCOMPATIBLE

var/mob/living/carbon/C = target
var/was_lying = C.body_position == LYING_DOWN
addtimer(CALLBACK(src, PROC_REF(Detach), C, was_lying, reverse), duration)
ADD_TRAIT(target, TRAIT_FLATTENED, VENDOR_FLATTENING_TRAIT)

if(reverse)
C.transform = C.transform.Scale(SHORT_SCALE, TALL_SCALE)

else
C.transform = C.transform.Scale(TALL_SCALE, SHORT_SCALE)

/datum/element/squish/Detach(mob/living/carbon/C, was_lying, reverse)
. = ..()
if(!istype(C))
return
var/is_lying = C.body_position == LYING_DOWN
REMOVE_TRAIT(C, TRAIT_FLATTENED, VENDOR_FLATTENING_TRAIT)

if(reverse)
is_lying = !is_lying

if(was_lying == is_lying)
C.transform = C.transform.Scale(SHORT_SCALE, TALL_SCALE)
else
C.transform = C.transform.Scale(TALL_SCALE, SHORT_SCALE)

#undef SHORT_SCALE
#undef TALL_SCALE

/datum/element/tilt_protection
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY

/datum/element/tilt_protection/Attach(datum/target, duration = 20 SECONDS)
. = ..()
if(!iscarbon(target))
return ELEMENT_INCOMPATIBLE
var/mob/living/carbon/C = target
addtimer(CALLBACK(src, PROC_REF(Detach), C), duration)
ADD_TRAIT(target, TRAIT_FLATTENED, VENDOR_FLATTENING_TRAIT)

/datum/element/tilt_protection/Detach(mob/living/carbon/C)
. = ..()
if(!istype(C))
return
REMOVE_TRAIT(C, TRAIT_FLATTENED, VENDOR_FLATTENING_TRAIT)
17 changes: 17 additions & 0 deletions code/game/machinery/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,23 @@
do_sparks(5, 0, loc)
playsound(loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)

/obj/machinery/suit_storage_unit/shove_impact(mob/living/target, mob/living/attacker)
if(target.incapacitated() || HAS_TRAIT(target, TRAIT_HANDS_BLOCKED) || target.buckled)
return
if(!state_open && !locked)
state_open = TRUE
update_icon(UPDATE_OVERLAYS)
return ..()

if(broken)
return ..()

if((occupant) || (helmet) || (suit) || (storage))
return ..()

close_machine(target)
return TRUE

//pirate ssu
/obj/machinery/suit_storage_unit/industrial
name = "industrial suit storage unit"
Expand Down
Loading

0 comments on commit fd0f45f

Please sign in to comment.