Basic Pirate NPCs (#79284)

## About The Pull Request

Converts hostile pirate NPCs to basic mobs - specifically, a subtype of
trooper. As their behavior is not meaningfully distinct from other
troopers, this conversion mostly just sticks them on the existing AI
behavior while keeping the rest the same.

Pirates do have one new thing going for them, though, to differentiate
them from other troopers. They use the new **plundering attacks**
component, which means that every time they land a melee attack, they
steal money from the bank account of whoever they hit. This requires the
target to be wearing an ID with a linked bank account, so it's not the
hardest thing in the world to hide your money from them - but it's still
something to be wary of! If killed, any mob with this component will
drop everything they've stolen in a convenient holochip.
## Why It's Good For The Game

Takes down 5 more simplemobs, and (I think) converts the last remaining
trooper-type enemy to be a basic trooper. (It's possible there's more
I've forgotten that could use the same AI, though.)

The money-stealing behavior is mostly good because I think it's funny,
but it also makes the pirates something a little distinct from "yet
another mob that runs at you and punches you until you die". They still
do that, but now there's a little twist! This can be placed on other
mobs too, if we want to make any other sorts of thieves or brigands.
## Changelog
🆑
refactor: Pirate NPCs now use the basic mob framework. They'll be a
little smarter in combat, and if you're wearing your ID they'll siphon
your bank account with every melee attack! Beware! Please report any
bugs.
/🆑
This commit is contained in:
lizardqueenlexi
2023-10-30 02:27:46 +00:00
committed by GitHub
parent 465fe994cc
commit 9e18c6575a
11 changed files with 162 additions and 115 deletions
@@ -0,0 +1,89 @@
/// Pirate trooper subtype
/mob/living/basic/trooper/pirate
name = "Pirate"
desc = "Does what he wants cause a pirate is free."
response_help_continuous = "pushes"
response_help_simple = "push"
speed = 0
speak_emote = list("yarrs")
faction = list(FACTION_PIRATE)
loot = list(/obj/effect/mob_spawn/corpse/human/pirate)
mob_spawner = /obj/effect/mob_spawn/corpse/human/pirate
/// The amount of money to steal with a melee attack
var/plunder_credits = 25
/mob/living/basic/trooper/pirate/Initialize(mapload)
. = ..()
AddComponent(/datum/component/plundering_attacks, plunder_amount = plunder_credits)
/mob/living/basic/trooper/pirate/melee
name = "Pirate Swashbuckler"
melee_damage_lower = 30
melee_damage_upper = 30
armour_penetration = 35
attack_verb_continuous = "slashes"
attack_verb_simple = "slash"
attack_sound = 'sound/weapons/blade1.ogg'
attack_vis_effect = ATTACK_EFFECT_SLASH
loot = list(/obj/effect/mob_spawn/corpse/human/pirate/melee)
light_range = 2
light_power = 2.5
light_color = COLOR_SOFT_RED
loot = list(
/obj/effect/mob_spawn/corpse/human/pirate/melee,
/obj/item/melee/energy/sword/pirate,
)
mob_spawner = /obj/effect/mob_spawn/corpse/human/pirate/melee
r_hand = /obj/item/melee/energy/sword/pirate
plunder_credits = 50 //they hit hard so they steal more
/mob/living/basic/trooper/pirate/melee/space
name = "Space Pirate Swashbuckler"
unsuitable_atmos_damage = 0
minimum_survivable_temperature = 0
speed = 1
loot = list(/obj/effect/mob_spawn/corpse/human/pirate/melee/space)
mob_spawner = /obj/effect/mob_spawn/corpse/human/pirate/melee/space
/mob/living/basic/trooper/pirate/melee/space/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT)
/mob/living/basic/trooper/pirate/ranged
name = "Pirate Gunner"
loot = list(/obj/effect/mob_spawn/corpse/human/pirate/ranged)
mob_spawner = /obj/effect/mob_spawn/corpse/human/pirate/ranged
r_hand = /obj/item/gun/energy/laser
ai_controller = /datum/ai_controller/basic_controller/trooper/ranged
/// Type of bullet we use
var/casingtype = /obj/item/ammo_casing/energy/laser
/// Sound to play when firing weapon
var/projectilesound = 'sound/weapons/laser.ogg'
/// number of burst shots
var/burst_shots = 2
/// Time between taking shots
var/ranged_cooldown = 6 SECONDS
/mob/living/basic/trooper/pirate/ranged/Initialize(mapload)
. = ..()
AddComponent(\
/datum/component/ranged_attacks,\
casing_type = casingtype,\
projectile_sound = projectilesound,\
cooldown_time = ranged_cooldown,\
burst_shots = burst_shots,\
)
/mob/living/basic/trooper/pirate/ranged/space
name = "Space Pirate Gunner"
unsuitable_atmos_damage = 0
minimum_survivable_temperature = 0
speed = 1
loot = list(/obj/effect/mob_spawn/corpse/human/pirate/ranged/space)
mob_spawner = /obj/effect/mob_spawn/corpse/human/pirate/ranged/space
r_hand = /obj/item/gun/energy/e_gun/lethal
/mob/living/basic/trooper/pirate/ranged/space/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT)
@@ -3,8 +3,6 @@
name = "Syndicate Operative"
desc = "Death to Nanotrasen."
speed = 1.1
melee_damage_lower = 10
melee_damage_upper = 10
faction = list(ROLE_SYNDICATE)
loot = list(/obj/effect/mob_spawn/corpse/human/syndicatesoldier)
mob_spawner = /obj/effect/mob_spawn/corpse/human/syndicatesoldier