Skip to content

Commit

Permalink
Merge branch 'master' into upstream-mirror-25274
Browse files Browse the repository at this point in the history
  • Loading branch information
ReezeBL authored Dec 4, 2023
2 parents 300fbbe + d31093b commit 87d55a7
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 19 deletions.
18 changes: 8 additions & 10 deletions code/__DEFINES/_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,25 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define ALLOW_DARK_PAINTS_1 (1<<9)
/// Should this object be unpaintable?
#define UNPAINTABLE_1 (1<<10)
/// Is the thing currently spinning?
#define IS_SPINNING_1 (1<<11)
/// Is this atom on top of another atom, and as such has click priority?
#define IS_ONTOP_1 (1<<12)
#define IS_ONTOP_1 (1<<11)
/// Is this atom immune to being dusted by the supermatter?
#define SUPERMATTER_IGNORES_1 (1<<13)
#define SUPERMATTER_IGNORES_1 (1<<12)
/// If a turf can be made dirty at roundstart. This is also used in areas.
#define CAN_BE_DIRTY_1 (1<<14)
#define CAN_BE_DIRTY_1 (1<<13)
/// Should we use the initial icon for display? Mostly used by overlay only objects
#define HTML_USE_INITAL_ICON_1 (1<<15)
#define HTML_USE_INITAL_ICON_1 (1<<14)
/// Can players recolor this in-game via vendors (and maybe more if support is added)?
#define IS_PLAYER_COLORABLE_1 (1<<16)
#define IS_PLAYER_COLORABLE_1 (1<<15)
/// Whether or not this atom has contextual screentips when hovered OVER
#define HAS_CONTEXTUAL_SCREENTIPS_1 (1<<17)
#define HAS_CONTEXTUAL_SCREENTIPS_1 (1<<16)
/// Whether or not this atom is storing contents for a disassociated storage object
#define HAS_DISASSOCIATED_STORAGE_1 (1<<18)
#define HAS_DISASSOCIATED_STORAGE_1 (1<<17)
/// If this atom has experienced a decal element "init finished" sourced appearance update
/// We use this to ensure stacked decals don't double up appearance updates for no rasin
/// Flag as an optimization, don't make this a trait without profiling
/// Yes I know this is a stupid flag, no you can't take him from me
#define DECAL_INIT_UPDATE_EXPERIENCED_1 (1<<19)
#define DECAL_INIT_UPDATE_EXPERIENCED_1 (1<<18)

// Update flags for [/atom/proc/update_appearance]
/// Update the atom's name
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define STATION_TRAIT_UNNATURAL_ATMOSPHERE "station_trait_unnatural_atmosphere"
#define STATION_TRAIT_VENDING_SHORTAGE "station_trait_vending_shortage"

/// This atom is currently spinning.
#define TRAIT_SPINNING "spinning"

/// Denotes that this id card was given via the job outfit, aka the first ID this player got.
#define TRAIT_JOB_FIRST_ID_CARD "job_first_id_card"
Expand Down
3 changes: 2 additions & 1 deletion code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ DEFINE_BITFIELD(flags_1, list(
"INITIALIZED_1" = INITIALIZED_1,
"IS_ONTOP_1" = IS_ONTOP_1,
"IS_PLAYER_COLORABLE_1" = IS_PLAYER_COLORABLE_1,
"IS_SPINNING_1" = IS_SPINNING_1,
"NO_SCREENTIPS_1" = NO_SCREENTIPS_1,
"NODECONSTRUCT_1" = NODECONSTRUCT_1,
"NO_SCREENTIPS_1" = NO_SCREENTIPS_1,
"NODECONSTRUCT_1" = NODECONSTRUCT_1,
"ON_BORDER_1" = ON_BORDER_1,
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_MAT_TRANSMUTED" = TRAIT_MAT_TRANSMUTED,
"TRAIT_RECENTLY_COINED" = TRAIT_RECENTLY_COINED,
"TRAIT_RUSTY" = TRAIT_RUSTY,
"TRAIT_SPINNING" = TRAIT_SPINNING,
"TRAIT_STICKERED" = TRAIT_STICKERED,
),
/atom/movable = list(
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/dna_infuser/organ_sets/roach_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
if(!ishuman(blocker) || blocker.stat >= UNCONSCIOUS)
return FALSE
// No tactical spinning
if(blocker.flags_1 & IS_SPINNING_1)
if(HAS_TRAIT(blocker, TRAIT_SPINNING))
return FALSE
if(blocker.body_position == LYING_DOWN || (blocker.dir & attack_direction))
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/heretic/knowledge/blade_lore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

var/are_we_behind = FALSE
// No tactical spinning allowed
if(target.flags_1 & IS_SPINNING_1)
if(HAS_TRAIT(target, TRAIT_SPINNING))
are_we_behind = TRUE

// We'll take "same tile" as "behind" for ease
Expand Down
2 changes: 1 addition & 1 deletion code/modules/assembly/flash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
// Tactical combat emote-spinning should not counter intended gameplay mechanics.
// This trumps same-loc checks to discourage floor spinning in general to counter flashes.
// In short, combat spinning is silly and you should feel silly for doing it.
if(victim.flags_1 & IS_SPINNING_1)
if(HAS_TRAIT(victim, TRAIT_SPINNING))
return DEVIATION_NONE

if(iscarbon(victim))
Expand Down
4 changes: 2 additions & 2 deletions code/modules/basketball/basketball.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
return

// spinning gives you a lower disarm chance but it drains stamina
var/disarm_chance = baller.flags_1 & IS_SPINNING_1 ? 35 : 50
var/disarm_chance = HAS_TRAIT(baller, TRAIT_SPINNING) ? 35 : 50
// ballers stamina results in lower disarm, stealer stamina results in higher disarm
disarm_chance += (baller.getStaminaLoss() - stealer.getStaminaLoss()) / 2
// the lowest chance for disarm is 25% and the highest is 75%
Expand Down Expand Up @@ -169,7 +169,7 @@
return

// need a free hand and can't be spinning
if(!user.put_in_inactive_hand(src) || user.flags_1 & IS_SPINNING_1)
if(!user.put_in_inactive_hand(src) || HAS_TRAIT(user, TRAIT_SPINNING))
return

last_use = world.time
Expand Down
2 changes: 1 addition & 1 deletion code/modules/basketball/hoop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
score_chance *= 0.5

// aim penalty for spinning while shooting
if(istype(thrower) && thrower.flags_1 & IS_SPINNING_1)
if(istype(thrower) && HAS_TRAIT(thrower, TRAIT_SPINNING))
score_chance *= 0.5

if(prob(score_chance))
Expand Down
8 changes: 6 additions & 2 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -745,14 +745,16 @@
/mob/proc/can_resist()
return FALSE //overridden in living.dm

#define SPIN_PROC_TRAIT "trait_from_spin()"

///Spin this mob around it's central axis
/mob/proc/spin(spintime, speed)
set waitfor = 0
var/D = dir
if((spintime < 1) || (speed < 1) || !spintime || !speed)
return

flags_1 |= IS_SPINNING_1
ADD_TRAIT(src, TRAIT_SPINNING, SPIN_PROC_TRAIT)
while(spintime >= speed)
sleep(speed)
switch(D)
Expand All @@ -766,7 +768,9 @@
D = NORTH
setDir(D)
spintime -= speed
flags_1 &= ~IS_SPINNING_1
REMOVE_TRAIT(src, TRAIT_SPINNING, SPIN_PROC_TRAIT)

#undef SPIN_PROC_TRAIT

///Update the pulling hud icon
/mob/proc/update_pull_hud_icon()
Expand Down

0 comments on commit 87d55a7

Please sign in to comment.