Skip to content

Commit

Permalink
[MIRROR] Basic Pirate NPCs [MDB IGNORE] (#355)
Browse files Browse the repository at this point in the history
* Basic Pirate NPCs (#79284)

* Modular paths

---------

Co-authored-by: lizardqueenlexi <[email protected]>
Co-authored-by: Giz <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2023
1 parent 580c5f2 commit 1f0ca6f
Show file tree
Hide file tree
Showing 14 changed files with 184 additions and 137 deletions.
8 changes: 4 additions & 4 deletions _maps/RandomRuins/SpaceRuins/caravanambush.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/area/template_noop)
"ah" = (
/obj/structure/lattice/catwalk,
/mob/living/simple_animal/hostile/pirate/ranged/space{
/mob/living/basic/trooper/pirate/ranged/space{
environment_smash = 0
},
/turf/template_noop,
Expand Down Expand Up @@ -587,7 +587,7 @@
dir = 4
},
/obj/effect/decal/cleanable/dirt,
/mob/living/simple_animal/hostile/pirate/ranged/space{
/mob/living/basic/trooper/pirate/ranged/space{
environment_smash = 0
},
/turf/open/floor/iron/airless,
Expand Down Expand Up @@ -736,7 +736,7 @@
/area/ruin/space/has_grav)
"Fr" = (
/obj/effect/decal/cleanable/dirt,
/mob/living/simple_animal/hostile/pirate/ranged/space{
/mob/living/basic/trooper/pirate/ranged/space{
environment_smash = 0
},
/turf/open/floor/plating/airless,
Expand Down Expand Up @@ -941,7 +941,7 @@
"Nm" = (
/obj/machinery/atmospherics/components/unary/vent_pump/on,
/obj/effect/decal/cleanable/dirt,
/mob/living/simple_animal/hostile/pirate/ranged/space{
/mob/living/basic/trooper/pirate/ranged/space{
environment_smash = 0
},
/turf/open/floor/iron/airless,
Expand Down
4 changes: 2 additions & 2 deletions _maps/RandomRuins/SpaceRuins/derelict_construction.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/area/ruin/space/has_grav/derelictconstruction)
"fa" = (
/obj/structure/lattice,
/mob/living/simple_animal/hostile/pirate/ranged/space,
/mob/living/basic/trooper/pirate/ranged/space,
/turf/template_noop,
/area/space/nearstation)
"gi" = (
Expand Down Expand Up @@ -416,7 +416,7 @@
/turf/open/floor/plating,
/area/ruin/space/has_grav/derelictconstruction)
"Za" = (
/mob/living/simple_animal/hostile/pirate/melee/space,
/mob/living/basic/trooper/pirate/melee/space,
/obj/structure/lattice/catwalk,
/turf/template_noop,
/area/ruin/space/has_grav/derelictconstruction)
Expand Down
4 changes: 2 additions & 2 deletions _maps/RandomRuins/SpaceRuins/skyrat/cargodiselost.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
/turf/open/floor/iron/smooth,
/area/ruin/space/has_grav/cargodise_freighter/utility)
"dT" = (
/mob/living/simple_animal/hostile/pirate/melee{
/mob/living/basic/trooper/pirate/melee{
faction = list("hostile")
},
/turf/open/floor/mineral/plastitanium,
Expand Down Expand Up @@ -2902,7 +2902,7 @@
/area/ruin/space/has_grav/cargodise_freighter/primaryhall)
"UP" = (
/obj/effect/turf_decal/trimline/blue/line,
/mob/living/simple_animal/hostile/pirate/melee{
/mob/living/basic/trooper/pirate/melee{
faction = list("hostile")
},
/turf/open/floor/iron/dark/textured_half{
Expand Down
30 changes: 15 additions & 15 deletions _maps/RandomRuins/SpaceRuins/skyrat/piratefort.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/powered)
"ga" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/turf/open/floor/carpet,
/area/ruin/space/has_grav/powered)
"ge" = (
Expand Down Expand Up @@ -340,7 +340,7 @@
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/powered)
"mx" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/obj/effect/turf_decal/trimline/dark_blue/filled/line{
dir = 10
},
Expand Down Expand Up @@ -459,7 +459,7 @@
/turf/open/floor/wood,
/area/ruin/space/has_grav/powered)
"pS" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/obj/effect/turf_decal/trimline/dark_red/filled/line{
dir = 8
},
Expand Down Expand Up @@ -665,7 +665,7 @@
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/powered)
"wr" = (
/mob/living/simple_animal/hostile/pirate/ranged,
/mob/living/basic/trooper/pirate/ranged,
/obj/effect/turf_decal/trimline/dark_red/filled/line{
dir = 8
},
Expand Down Expand Up @@ -737,7 +737,7 @@
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/powered)
"xM" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/turf/open/floor/wood,
/area/ruin/space/has_grav/powered)
"xV" = (
Expand Down Expand Up @@ -779,7 +779,7 @@
/turf/open/floor/iron/kitchen,
/area/ruin/space/has_grav/powered)
"yE" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/obj/effect/turf_decal/trimline/dark_red/filled/corner{
dir = 8
},
Expand Down Expand Up @@ -837,7 +837,7 @@
/turf/open/floor/carpet,
/area/ruin/space/has_grav/powered)
"AA" = (
/mob/living/simple_animal/hostile/pirate/ranged,
/mob/living/basic/trooper/pirate/ranged,
/obj/effect/turf_decal/trimline/dark_red/filled/line{
dir = 4
},
Expand Down Expand Up @@ -944,7 +944,7 @@
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/powered)
"EC" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/obj/effect/turf_decal/trimline/dark_red/filled/line{
dir = 1
},
Expand Down Expand Up @@ -999,7 +999,7 @@
/turf/open/floor/iron/kitchen,
/area/ruin/space/has_grav/powered)
"Gc" = (
/mob/living/simple_animal/hostile/pirate/ranged,
/mob/living/basic/trooper/pirate/ranged,
/turf/open/floor/wood,
/area/ruin/space/has_grav/powered)
"Gf" = (
Expand Down Expand Up @@ -1096,7 +1096,7 @@
/turf/closed/wall/r_wall/syndicate,
/area/ruin/space/has_grav/powered)
"LG" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/powered)
"LI" = (
Expand All @@ -1112,7 +1112,7 @@
/turf/open/floor/wood,
/area/ruin/space/has_grav/powered)
"Ma" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/obj/effect/turf_decal/trimline/dark_red/filled/line,
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/powered)
Expand Down Expand Up @@ -1281,7 +1281,7 @@
/turf/open/floor/plating,
/area/ruin/space/has_grav/powered)
"TK" = (
/mob/living/simple_animal/hostile/pirate/ranged/space,
/mob/living/basic/trooper/pirate/ranged/space,
/turf/open/misc/asteroid/lowpressure,
/area/ruin/space)
"TO" = (
Expand Down Expand Up @@ -1332,7 +1332,7 @@
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/powered)
"UL" = (
/mob/living/simple_animal/hostile/pirate/ranged{
/mob/living/basic/trooper/pirate/ranged{
health = 200;
maxHealth = 200;
name = "Pirate Captain"
Expand Down Expand Up @@ -1360,11 +1360,11 @@
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/powered)
"VI" = (
/mob/living/simple_animal/hostile/pirate/melee/space,
/mob/living/basic/trooper/pirate/melee/space,
/turf/open/misc/asteroid/lowpressure,
/area/ruin/space)
"VL" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/obj/effect/turf_decal/trimline/dark_red/filled/corner{
dir = 1
},
Expand Down
10 changes: 5 additions & 5 deletions _maps/RandomZLevels/mothership_astrum.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@
/turf/open/misc/beach/coast,
/area/awaymission/mothership_astrum/deck5)
"tz" = (
/mob/living/simple_animal/hostile/pirate/ranged{
/mob/living/basic/trooper/pirate/ranged{
faction = list("Abductor")
},
/turf/open/misc/beach/sand,
Expand Down Expand Up @@ -1777,7 +1777,7 @@
/turf/open/floor/mineral/abductor,
/area/awaymission/mothership_astrum/halls)
"CU" = (
/mob/living/simple_animal/hostile/pirate/melee{
/mob/living/basic/trooper/pirate/melee{
faction = list("Abductor");
loot = list(/obj/effect/mob_spawn/corpse/human/pirate)
},
Expand Down Expand Up @@ -1844,7 +1844,7 @@
/turf/open/floor/plating/abductor,
/area/awaymission/mothership_astrum/halls)
"DE" = (
/mob/living/simple_animal/hostile/pirate/ranged{
/mob/living/basic/trooper/pirate/ranged{
faction = list("Abductor")
},
/turf/open/floor/wood,
Expand Down Expand Up @@ -2305,10 +2305,10 @@
},
/area/awaymission/mothership_astrum/deck1)
"IO" = (
/mob/living/simple_animal/hostile/pirate/ranged{
/mob/living/basic/trooper/pirate/ranged{
faction = list("Abductor")
},
/mob/living/simple_animal/hostile/pirate/ranged{
/mob/living/basic/trooper/pirate/ranged{
faction = list("Abductor");
health = 200
},
Expand Down
6 changes: 3 additions & 3 deletions _maps/shuttles/ruin_pirate_cutter.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
/turf/open/floor/plating,
/area/shuttle/ruin/caravan/pirate)
"iN" = (
/mob/living/simple_animal/hostile/pirate/melee{
/mob/living/basic/trooper/pirate/melee{
environment_smash = 0
},
/turf/open/floor/iron,
Expand Down Expand Up @@ -139,7 +139,7 @@
pixel_y = -30;
req_access = null
},
/mob/living/simple_animal/hostile/pirate/ranged{
/mob/living/basic/trooper/pirate/ranged{
environment_smash = 0
},
/obj/effect/turf_decal/tile/neutral/fourcorners,
Expand Down Expand Up @@ -787,7 +787,7 @@
/area/shuttle/ruin/caravan/pirate)
"WV" = (
/obj/effect/decal/cleanable/dirt,
/mob/living/simple_animal/hostile/pirate/ranged{
/mob/living/basic/trooper/pirate/ranged{
environment_smash = 0
},
/turf/open/floor/iron,
Expand Down
14 changes: 7 additions & 7 deletions _maps/virtual_domains/pirates.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
dir = 8
},
/obj/effect/decal/cleanable/dirt/dust,
/mob/living/simple_animal/hostile/pirate/ranged/space,
/mob/living/basic/trooper/pirate/ranged/space,
/turf/open/floor/carpet/blue,
/area/virtual_domain/powered)
"iO" = (
Expand Down Expand Up @@ -293,7 +293,7 @@
/area/virtual_domain/powered)
"nX" = (
/obj/effect/decal/cleanable/dirt/dust,
/mob/living/simple_animal/hostile/pirate/melee/space,
/mob/living/basic/trooper/pirate/melee/space,
/turf/open/floor/wood/parquet,
/area/virtual_domain/powered)
"oo" = (
Expand Down Expand Up @@ -342,7 +342,7 @@
},
/obj/effect/mapping_helpers/burnt_floor,
/obj/effect/decal/cleanable/dirt/dust,
/mob/living/simple_animal/hostile/pirate/ranged,
/mob/living/basic/trooper/pirate/ranged,
/turf/open/floor/wood,
/area/virtual_domain/powered)
"qN" = (
Expand Down Expand Up @@ -385,7 +385,7 @@
/turf/open/misc/grass,
/area/virtual_domain/powered)
"to" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/turf/open/misc/grass,
/area/virtual_domain/powered)
"ub" = (
Expand Down Expand Up @@ -472,7 +472,7 @@
/turf/open/misc/dirt/jungle,
/area/virtual_domain/powered)
"yi" = (
/mob/living/simple_animal/hostile/pirate/melee,
/mob/living/basic/trooper/pirate/melee,
/turf/open/misc/beach/sand,
/area/virtual_domain/powered)
"yq" = (
Expand All @@ -481,7 +481,7 @@
/area/virtual_domain/powered)
"yw" = (
/obj/effect/mapping_helpers/burnt_floor,
/mob/living/simple_animal/hostile/pirate/ranged,
/mob/living/basic/trooper/pirate/ranged,
/obj/structure/chair/wood,
/turf/open/floor/wood{
icon_state = "wood_large"
Expand Down Expand Up @@ -616,7 +616,7 @@
/area/virtual_domain/powered)
"Hp" = (
/obj/effect/turf_decal/siding/wood,
/mob/living/simple_animal/hostile/pirate/ranged,
/mob/living/basic/trooper/pirate/ranged,
/turf/open/floor/wood,
/area/virtual_domain/powered)
"HY" = (
Expand Down
54 changes: 54 additions & 0 deletions code/datums/components/plundering_attacks.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* Component that makes basic mobs' melee attacks steal money from the target's ID card.
* Plundered money is stored and dropped on death or removal of the component.
*/
/datum/component/plundering_attacks
/// How many credits do we steal per attack?
var/plunder_amount = 25
/// How much plunder do we have stored?
var/plunder_stored = 0


/datum/component/plundering_attacks/Initialize(
plunder_amount = 25,
)
. = ..()
if(!isbasicmob(parent))
return COMPONENT_INCOMPATIBLE

src.plunder_amount = plunder_amount

/datum/component/plundering_attacks/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_HOSTILE_POST_ATTACKINGTARGET, PROC_REF(attempt_plunder))
RegisterSignal(parent, COMSIG_LIVING_DEATH, PROC_REF(drop_plunder))

/datum/component/plundering_attacks/UnregisterFromParent()
. = ..()
UnregisterSignal(parent, list(COMSIG_HOSTILE_POST_ATTACKINGTARGET, COMSIG_LIVING_DEATH))
drop_plunder()

/datum/component/plundering_attacks/proc/attempt_plunder(mob/living/attacker, mob/living/carbon/human/target, success)
SIGNAL_HANDLER
if(!istype(target) || !success)
return
var/obj/item/card/id/id_card = target.wear_id?.GetID()
if(isnull(id_card))
return
var/datum/bank_account/account_to_rob = id_card.registered_account
if(isnull(account_to_rob) || account_to_rob.account_balance == 0)
return

var/amount_to_steal = plunder_amount
if(account_to_rob.account_balance < plunder_amount) //If there isn't enough, just take what's left
amount_to_steal = account_to_rob.account_balance
plunder_stored += amount_to_steal
account_to_rob.adjust_money(-amount_to_steal)
account_to_rob.bank_card_talk("Transaction confirmed! Transferred [amount_to_steal] credits to \<NULL_ACCOUNT\>!")

/datum/component/plundering_attacks/proc/drop_plunder()
SIGNAL_HANDLER
if(plunder_stored == 0)
return
new /obj/item/holochip(get_turf(parent), plunder_stored)
plunder_stored = 0
Loading

0 comments on commit 1f0ca6f

Please sign in to comment.