Skip to content

Commit

Permalink
Condensing Process_Spacemove().
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jan 23, 2025
1 parent 0e44754 commit 17ea5f6
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 127 deletions.
6 changes: 6 additions & 0 deletions code/modules/mob/living/simple_animal/_simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
/decl/move_intent/run/animal
)

// Set to TRUE to ignore slipping while EVA
var/skip_spacemove = FALSE

/// Added to the delay expected from movement decls.
var/base_movement_delay = 0

Expand Down Expand Up @@ -583,3 +586,6 @@ var/global/list/simplemob_icon_bitflag_cache = list()
/mob/living/simple_animal/set_stat(var/new_stat)
if((. = ..()))
queue_icon_update()

/mob/living/simple_animal/Process_Spacemove(allow_movement)
return skip_spacemove ? 1 : ..()
18 changes: 8 additions & 10 deletions code/modules/mob/living/simple_animal/familiars/familiars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,23 @@
*/

/mob/living/simple_animal/familiar/pike
name = "space pike"
desc = "A bigger, more magical cousin of the space carp."
icon = 'icons/mob/simple_animal/spaceshark.dmi'
name = "space pike"
desc = "A bigger, more magical cousin of the space carp."
icon = 'icons/mob/simple_animal/spaceshark.dmi'
pixel_x = -16
offset_overhead_text_x = 16

speak_emote = list("gnashes")
max_health = 100
speak_emote = list("gnashes")
max_health = 100
natural_weapon = /obj/item/natural_weapon/bite
min_gas = null
min_gas = null
wizardy_spells = list(/spell/aoe_turf/conjure/forcewall)
ai = /datum/mob_controller/familiar_pike
ai = /datum/mob_controller/familiar_pike
skip_spacemove = TRUE

/datum/mob_controller/familiar_pike
can_escape_buckles = TRUE

/mob/living/simple_animal/familiar/pike/Process_Spacemove()
return 1 //No drifting in space for space carp! //original comments do not steal

/mob/living/simple_animal/familiar/horror
name = "horror"
desc = "Looking at it fills you with dread."
Expand Down
26 changes: 12 additions & 14 deletions code/modules/mob/living/simple_animal/hostile/carp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
desc = "A ferocious, fang-bearing creature that resembles a fish."
icon = 'icons/mob/simple_animal/space_carp.dmi'

max_health = 50
harm_intent_damage = 8
natural_weapon = /obj/item/natural_weapon/bite
max_health = 50
harm_intent_damage = 8
natural_weapon = /obj/item/natural_weapon/bite
base_movement_delay = 2

//Space carp aren't affected by atmos.
min_gas = null
max_gas = null
minbodytemp = 0
faction = "carp"
bleed_colour = "#5d0d71"
pass_flags = PASS_FLAG_TABLE
butchery_data = /decl/butchery_data/animal/fish/space_carp
ai = /datum/mob_controller/aggressive/carp
min_gas = null
max_gas = null
minbodytemp = 0
faction = "carp"
bleed_colour = "#5d0d71"
pass_flags = PASS_FLAG_TABLE
butchery_data = /decl/butchery_data/animal/fish/space_carp
ai = /datum/mob_controller/aggressive/carp
ability_handlers = list(/datum/ability_handler/predator)
skip_spacemove = TRUE

var/carp_color = COLOR_PURPLE

Expand Down Expand Up @@ -57,6 +58,3 @@
var/image/I = image(icon, "[icon_state]-eyes")
I.appearance_flags |= RESET_COLOR
add_overlay(I)

/mob/living/simple_animal/hostile/carp/Process_Spacemove()
return 1 //No drifting in space for space carp! //original comments do not steal
48 changes: 23 additions & 25 deletions code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@

//malfunctioning combat drones
/mob/living/simple_animal/hostile/malf_drone
name = "combat drone"
desc = "An automated combat drone armed with state of the art weaponry and shielding."
icon = 'icons/mob/simple_animal/drone_combat.dmi'
burst_projectile = 0
a_intent = I_HURT
max_health = 300
move_intents = list(
name = "combat drone"
desc = "An automated combat drone armed with state of the art weaponry and shielding."
icon = 'icons/mob/simple_animal/drone_combat.dmi'
burst_projectile = 0
a_intent = I_HURT
max_health = 300
move_intents = list(
/decl/move_intent/walk/animal_slow,
/decl/move_intent/run/animal_slow
)
projectiletype = /obj/item/projectile/beam/drone
projectilesound = 'sound/weapons/laser3.ogg'
gene_damage = -1
butchery_data = /decl/butchery_data/synthetic
bleed_colour = SYNTH_BLOOD_COLOR
projectiletype = /obj/item/projectile/beam/drone
projectilesound = 'sound/weapons/laser3.ogg'
gene_damage = -1
butchery_data = /decl/butchery_data/synthetic
bleed_colour = SYNTH_BLOOD_COLOR
ai = /datum/mob_controller/aggressive/malf_drone
base_movement_delay = 2
ai = /datum/mob_controller/aggressive/malf_drone

//Drones aren't affected by atmos.
min_gas = null
max_gas = null
minbodytemp = 0
faction = "malf_drone"
min_gas = null
max_gas = null
minbodytemp = 0
faction = "malf_drone"
skip_spacemove = TRUE

var/has_loot = 1
var/datum/effect/effect/system/trail/ion_trail
var/has_loot = 1
var/explode_chance = 1
var/disabled = 0
var/exploding = 0
var/disabled = 0
var/exploding = 0

var/static/list/debris = list(
/decl/material/solid/glass = /obj/item/shard,
/decl/material/solid/metal/steel = /obj/item/stack/material/rods,
/decl/material/solid/glass = /obj/item/shard,
/decl/material/solid/metal/steel = /obj/item/stack/material/rods,
/decl/material/solid/metal/plasteel = null
)

Expand Down Expand Up @@ -76,9 +77,6 @@
ion_trail.set_up(src)
ion_trail.start()

/mob/living/simple_animal/hostile/malf_drone/Process_Spacemove()
return 1

/mob/living/simple_animal/hostile/malf_drone/proc/Haywire()
var/datum/mob_controller/aggressive/malf_drone/drone_ai = ai
if(prob(disabled ? 0 : 1) && istype(drone_ai) && drone_ai.malfunctioning)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,31 @@

//the king and his court
/mob/living/simple_animal/hostile/goat/king
name = "king of goats"
desc = "The oldest and wisest of goats; king of his race, peerless in dignity and power. His golden fleece radiates nobility."
icon = 'icons/mob/simple_animal/goat_king.dmi'
speak_emote = list("brays in a booming voice")
ai = /datum/mob_controller/aggressive/goat/king
response_harm = "assaults"
max_health = 500
mob_size = MOB_SIZE_LARGE
mob_bump_flag = HEAVY
move_intents = list(
name = "king of goats"
desc = "The oldest and wisest of goats; king of his race, peerless in dignity and power. His golden fleece radiates nobility."
icon = 'icons/mob/simple_animal/goat_king.dmi'
speak_emote = list("brays in a booming voice")
ai = /datum/mob_controller/aggressive/goat/king
response_harm = "assaults"
max_health = 500
mob_size = MOB_SIZE_LARGE
mob_bump_flag = HEAVY
move_intents = list(
/decl/move_intent/walk/animal,
/decl/move_intent/run/animal
)
min_gas = null
max_gas = null
minbodytemp = 0
flash_protection = FLASH_PROTECTION_MAJOR
natural_weapon = /obj/item/natural_weapon/goatking
var/current_damtype = BRUTE
min_gas = null
max_gas = null
minbodytemp = 0
flash_protection = FLASH_PROTECTION_MAJOR
natural_weapon = /obj/item/natural_weapon/goatking
skip_spacemove = TRUE
var/current_damtype = BRUTE
var/stun_chance = 5 //chance per attack to Weaken target
var/list/elemental_weapons = list(
BURN = /obj/item/natural_weapon/goatking/fire,
ELECTROCUTE = /obj/item/natural_weapon/goatking/lightning
)
var/stun_chance = 5 //chance per attack to Weaken target

/mob/living/simple_animal/hostile/goat/king/proc/OnDeath()
visible_message(SPAN_CULT_ANNOUNCE("\The [src] lets loose a terrific wail as its wounds close shut with a flash of light, and its eyes glow even brighter than before!"))
Expand All @@ -69,9 +70,6 @@
ADJ_STATUS(target, STAT_CONFUSE, 1)
visible_message(SPAN_WARNING("\The [target] is bowled over by the impact of [src]'s attack!"))

/mob/living/simple_animal/hostile/goat/king/Process_Spacemove()
return 1

/mob/living/simple_animal/hostile/goat/king/get_natural_weapon()
if(!(current_damtype in elemental_weapons))
return ..()
Expand Down
35 changes: 15 additions & 20 deletions code/modules/mob/living/simple_animal/hostile/revenant.dm
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
/mob/living/simple_animal/hostile/revenant
name = "revenant"
desc = "A flickering humanoid shadow that exudes a palpable sense of mance."
icon = 'icons/mob/simple_animal/revenant.dmi'
response_help_1p = "You wave your hand through $TARGET$."
response_help_3p = "$USER$ waves $USER_THEIR$ hand through $TARGET$."
max_health = 80
gene_damage = -1
ai = /datum/mob_controller/aggressive/revenant

name = "revenant"
desc = "A flickering humanoid shadow that exudes a palpable sense of mance."
icon = 'icons/mob/simple_animal/revenant.dmi'
response_help_1p = "You wave your hand through $TARGET$."
response_help_3p = "$USER$ waves $USER_THEIR$ hand through $TARGET$."
max_health = 80
gene_damage = -1
ai = /datum/mob_controller/aggressive/revenant
harm_intent_damage = 10
natural_weapon = /obj/item/natural_weapon/revenant

min_gas = null
max_gas = null
minbodytemp = 0

faction = "revenants"
supernatural = 1
natural_weapon = /obj/item/natural_weapon/revenant
min_gas = null
max_gas = null
minbodytemp = 0
skip_spacemove = TRUE
faction = "revenants"
supernatural = TRUE

/datum/mob_controller/aggressive/revenant
speak_chance = 0
Expand All @@ -34,9 +32,6 @@
atom_damage_type = BURN
_base_attack_force = 15

/mob/living/simple_animal/hostile/revenant/Process_Spacemove()
return 1

/mob/living/simple_animal/hostile/revenant/apply_attack_effects(mob/living/target)
. = ..()
if(prob(12))
Expand Down
44 changes: 21 additions & 23 deletions code/modules/mob/living/simple_animal/hostile/vagrant.dm
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
/mob/living/simple_animal/hostile/vagrant
name = "creature"
desc = "You get the feeling you should run."
icon = 'icons/mob/simple_animal/vagrant.dmi'
max_health = 60
move_intents = list(
name = "creature"
desc = "You get the feeling you should run."
icon = 'icons/mob/simple_animal/vagrant.dmi'
max_health = 60
move_intents = list(
/decl/move_intent/walk/animal_fast,
/decl/move_intent/run/animal_fast
)
faction = "vagrant"
harm_intent_damage = 3
natural_weapon = /obj/item/natural_weapon/bite/weak
light_color = "#8a0707"
min_gas = null
max_gas = null
minbodytemp = 0
gene_damage = -1
pass_flags = PASS_FLAG_TABLE
bleed_colour = "#aad9de"
nutrition = 100
ai = /datum/mob_controller/aggressive/vagrant
faction = "vagrant"
harm_intent_damage = 3
natural_weapon = /obj/item/natural_weapon/bite/weak
light_color = "#8a0707"
min_gas = null
max_gas = null
minbodytemp = 0
gene_damage = -1
pass_flags = PASS_FLAG_TABLE
bleed_colour = "#aad9de"
nutrition = 100
ai = /datum/mob_controller/aggressive/vagrant
base_movement_delay = 2
skip_spacemove = TRUE

var/cloaked = 0
var/mob/living/human/gripping = null
var/blood_per_tick = 3
var/cloaked = 0
var/blood_per_tick = 3
var/health_per_tick = 0.8
var/mob/living/human/gripping

/datum/mob_controller/aggressive/vagrant
speak_chance = 0
turns_per_wander = 8
break_stuff_probability = 0

/mob/living/simple_animal/hostile/vagrant/Process_Spacemove()
return 1

/mob/living/simple_animal/hostile/vagrant/bullet_act(var/obj/item/projectile/Proj)
var/oldhealth = current_health
. = ..()
Expand Down
14 changes: 12 additions & 2 deletions code/modules/mob/mob_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@
var/obj/item/tank/jetpack/thrust = get_jetpack()
if(thrust?.on && (allow_movement || thrust.stabilization_on) && thrust.allow_thrust(0.01, src))
return TRUE
// This is horrible but short of spawning a jetpack inside the organ than locating
// it, I don't really see another viable approach short of a total jetpack refactor.
for(var/obj/item/organ/internal/powered/jets/jet in get_internal_organs())
if(!jet.is_broken() && jet.active)
// Unlike Bay, we don't check or unset inertia_dir here
// because the spacedrift subsystem checks the return value of this proc
// and unsets inertia_dir if it returns nonzero.
return TRUE
return ..()

/mob/proc/space_do_move(var/allow_move, var/direction)
Expand All @@ -170,14 +178,16 @@

//return 1 if slipped, 0 otherwise
/mob/proc/handle_spaceslipping()
if(prob(skill_fail_chance(SKILL_EVA, slip_chance(10), SKILL_EXPERT)))
var/slip_prob = slip_chance(10)
world << "handling spaceslipping with prob [slip_prob]!"
if(prob(skill_fail_chance(SKILL_EVA, slip_prob, SKILL_EXPERT)))
to_chat(src, SPAN_DANGER("You slipped!"))
step(src,turn(last_move, pick(45,-45)))
return TRUE
return FALSE

/mob/proc/slip_chance(var/prob_slip = 10)
if(stat)
if(current_posture?.prone)
return 0
if(!can_slip(magboots_only = TRUE))
return 0
Expand Down
13 changes: 0 additions & 13 deletions mods/species/bayliens/bayliens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,3 @@
SSmodpacks.default_submap_whitelisted_species |= SPECIES_LIZARD
SSmodpacks.default_submap_whitelisted_species |= SPECIES_SKRELL
SSmodpacks.default_submap_whitelisted_species |= SPECIES_ADHERENT

/mob/living/human/Process_Spacemove(allow_movement)
. = ..()
if(.)
return
// This is horrible but short of spawning a jetpack inside the organ than locating
// it, I don't really see another viable approach short of a total jetpack refactor.
for(var/obj/item/organ/internal/powered/jets/jet in get_internal_organs())
if(!jet.is_broken() && jet.active)
// Unlike Bay, we don't check or unset inertia_dir here
// because the spacedrift subsystem checks the return value of this proc
// and unsets inertia_dir if it returns nonzero.
return 1

0 comments on commit 17ea5f6

Please sign in to comment.