From 45d5e4840b979c2a89af260c39107d02e9a91b55 Mon Sep 17 00:00:00 2001 From: Neerti Date: Sun, 1 Jul 2018 10:37:27 -0400 Subject: [PATCH 1/2] Ports carp to new AI system, adds new mob class type for holocarp. --- code/__defines/mobs.dm | 1 + .../ai/aI_holder_subtypes/simple_mob_ai.dm | 3 +- .../animal/giant_spider/giant_spider.dm | 1 + .../simple_mob/subtypes/animal/space/carp.dm | 125 ++++++++++++++++++ .../simple_mob/subtypes/animal/space/space.dm | 11 ++ polaris.dme | 2 + 6 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm create mode 100644 code/modules/mob/living/simple_mob/subtypes/animal/space/space.dm diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index d93564f4a5..0bce785f6d 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -303,6 +303,7 @@ #define MOB_CLASS_DEMONIC 64 // Cult stuff. #define MOB_CLASS_BOSS 128 // Future megafauna hopefully someday. #define MOB_CLASS_ILLUSION 256 // Fake mobs, e.g. Technomancer illusions. +#define MOB_CLASS_PHOTONIC 512 // Holographic mobs like holocarp, similar to _ILLUSION, but that make no attempt to hide their true nature. #define MOB_CLASS_ALL (~MOB_CLASS_NONE) diff --git a/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm b/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm index 39e291d192..1a4059bd2b 100644 --- a/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm +++ b/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm @@ -6,11 +6,12 @@ returns_home = FALSE can_flee = FALSE speak_chance = 1 // If the mob's saylist is empty, nothing will happen. + wander = TRUE + base_wander_delay = 4 // For animals. /datum/ai_holder/simple_mob/passive hostile = FALSE - wander = TRUE can_flee = TRUE // Ranged mobs. diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/giant_spider.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/giant_spider.dm index 052ee0017c..5456959da1 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/giant_spider.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/giant_spider.dm @@ -38,6 +38,7 @@ speak_emote = list("chitters") + meat_amount = 1 meat_type = /obj/item/weapon/reagent_containers/food/snacks/xenomeat/spidermeat say_list_type = /datum/say_list/spider diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm new file mode 100644 index 0000000000..a0463fc9fc --- /dev/null +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm @@ -0,0 +1,125 @@ +// Space carp show up as a random event to wreck hapless people in space or near windows. +// They generally fit the archetype of 'fast but fragile'. +// This is compensated by being in groups (usually). +/mob/living/simple_mob/animal/space/carp + name = "space carp" + desc = "A ferocious, fang-bearing creature that resembles a fish." + icon_state = "carp" + icon_living = "carp" + icon_dead = "carp_dead" + icon_gib = "carp_gib" + + faction = "carp" + maxHealth = 25 + health = 25 + movement_cooldown = 0 // Carp go fast + hovering = TRUE. + + response_help = "pets the" + response_disarm = "gently pushes aside the" + response_harm = "hits the" + + melee_damage_lower = 7 // About 14 DPS. + melee_damage_upper = 7 + base_attack_cooldown = 10 // One attack a second. + attack_sharp = TRUE + attack_sound = 'sound/weapons/bite.ogg' + attacktext = list("bitten") + + meat_amount = 1 + meat_type = /obj/item/weapon/reagent_containers/food/snacks/carpmeat + + ai_holder_type = /datum/ai_holder/simple_mob/melee + + var/knockdown_chance = 15 + +/mob/living/simple_mob/animal/space/carp/Process_Spacemove(var/check_drift = 0) + return TRUE //No drifting in space for space carp! //original comments do not steal // stolen. + +/mob/living/simple_mob/animal/space/carp/apply_melee_effects(var/atom/A) + if(isliving(A)) + var/mob/living/L = A + if(prob(knockdown_chance)) + L.Weaken(3) + L.visible_message(span("danger", "\The [src] knocks down \the [L]!")) + + +// Subtypes. +/mob/living/simple_mob/animal/space/carp/large + name = "elder carp" + desc = "An older, more matured carp. Few survive to this age due to their aggressiveness." + icon = 'icons/mob/64x32.dmi' + icon_state = "shark" + icon_living = "shark" + icon_dead = "shark_dead" + + maxHealth = 50 + health = 50 + movement_cooldown = 10 // Slower than the younger carp. + mob_size = MOB_LARGE + + pixel_x = -16 + old_x = -16 + + meat_amount = 3 + + +/mob/living/simple_mob/animal/space/carp/large/huge + name = "great white carp" + desc = "A very rare breed of carp- and a very aggressive one." + icon = 'icons/mob/64x64.dmi' + icon_dead = "megacarp_dead" + icon_living = "megacarp" + icon_state = "megacarp" + + maxHealth = 230 + health = 230 + + melee_damage_lower = 15 // About 20 DPS. + melee_damage_upper = 25 + + old_y = -16 + pixel_y = -16 + + meat_amount = 10 + + +/mob/living/simple_mob/animal/space/carp/holographic + name = "holographic carp" + desc = "An obviously holographic, but still ferocious looking carp." + // Might be worth using a filter similar to AI holograms in the future. + icon = 'icons/mob/AI.dmi' + icon_state = "holo4" + icon_living = "holo4" + icon_dead = "holo4" + alpha = 127 + icon_gib = null + meat_amount = 0 + meat_type = null + + mob_class = MOB_CLASS_PHOTONIC // Xeno-taser won't work on this as its not a 'real' carp. + +/mob/living/simple_mob/animal/space/carp/holographic/initialize() + set_light(2) // Hologram lighting. + return ..() + +// Presumably the holodeck emag code requires this. +// Pass TRUE to make safe. Pass FALSE to make unsafe. +/mob/living/simple_mob/animal/space/carp/holographic/proc/set_safety(safe) + if(!isnull(get_AI_stance())) // Will return null if lacking an AI holder or a player is controlling it w/o autopilot var. + ai_holder.hostile = !safe // Inverted so safe = TRUE means hostility = FALSE. + ai_holder.forget_everything() // Reset state so it'll stop chewing on its target. + +// Called on death. +/mob/living/simple_mob/animal/space/carp/holographic/proc/derez() + visible_message(span("notice", "\The [src] fades away!")) + qdel(src) + +/mob/living/simple_mob/animal/space/carp/holographic/gib() + derez() // Holograms can't gib. + +/mob/living/simple_mob/animal/space/carp/holographic/death() + ..() + derez() + + diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/space.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/space.dm new file mode 100644 index 0000000000..9976e783b4 --- /dev/null +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/space.dm @@ -0,0 +1,11 @@ +// 'Space' mobs don't care about atmos (like carp) +/mob/living/simple_mob/animal/space + min_oxy = 0 + max_oxy = 0 + min_tox = 0 + max_tox = 0 + min_co2 = 0 + max_co2 = 0 + min_n2 = 0 + max_n2 = 0 + minbodytemp = 0 \ No newline at end of file diff --git a/polaris.dme b/polaris.dme index 981591f933..65efe0bf85 100644 --- a/polaris.dme +++ b/polaris.dme @@ -1975,6 +1975,8 @@ #include "code\modules\mob\living\simple_mob\subtypes\animal\giant_spider\tunneler.dm" #include "code\modules\mob\living\simple_mob\subtypes\animal\sif\hooligan_crab.dm" #include "code\modules\mob\living\simple_mob\subtypes\animal\sif\sif.dm" +#include "code\modules\mob\living\simple_mob\subtypes\animal\space\carp.dm" +#include "code\modules\mob\living\simple_mob\subtypes\animal\space\space.dm" #include "code\modules\mob\living\simple_mob\subtypes\humanoid\humanoid.dm" #include "code\modules\mob\living\simple_mob\subtypes\humanoid\mercs\mercs.dm" #include "code\modules\mob\living\simple_mob\subtypes\mechanical\combat_drone.dm" From 6d2d3dda87673a1e6103236851e0f5f202d8f324 Mon Sep 17 00:00:00 2001 From: Neerti Date: Wed, 4 Jul 2018 10:54:38 -0400 Subject: [PATCH 2/2] Tweaks carp speed --- .../mob/living/simple_mob/subtypes/animal/space/carp.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm index a0463fc9fc..1e3805a602 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/carp.dm @@ -55,7 +55,7 @@ maxHealth = 50 health = 50 - movement_cooldown = 10 // Slower than the younger carp. + movement_cooldown = 5 // Slower than the younger carp. mob_size = MOB_LARGE pixel_x = -16 @@ -74,6 +74,7 @@ maxHealth = 230 health = 230 + movement_cooldown = 10 melee_damage_lower = 15 // About 20 DPS. melee_damage_upper = 25