Adds powerup system, refactors ctf pickups and powerup mine subtypes into it (#56605)

This commit is contained in:
Fikou
2021-02-04 08:46:08 +01:00
committed by GitHub
parent 47a8ea5746
commit efbb133167
14 changed files with 218 additions and 140 deletions
+1 -5
View File
@@ -170,11 +170,7 @@
var/mob/living/M = AM
M.forceMove(get_turf(LA))
to_chat(M, "<span class='reallybig redtext'>You're trapped in a deadly arena! To escape, you'll need to drag a severed head to the escape portals.</span>", confidential = TRUE)
INVOKE_ASYNC(src, .proc/do_bloodbath, M)
/obj/effect/forcefield/arena_shuttle_entrance/proc/do_bloodbath(mob/living/L)
var/obj/effect/mine/pickup/bloodbath/B = new (L)
B.mineEffect(L)
M.apply_status_effect(STATUS_EFFECT_MAYHEM)
/area/shuttle_arena
name = "arena"
+1 -43
View File
@@ -4,7 +4,6 @@
#define FLAG_RETURN_TIME 200 // 20 seconds
#define INSTAGIB_RESPAWN 50 //5 seconds
#define DEFAULT_RESPAWN 150 //15 seconds
#define AMMO_DROP_LIFETIME 300
#define CTF_REQUIRED_PLAYERS 4
/obj/item/ctf
@@ -184,8 +183,7 @@
///assoc list for classes. If there's only one, it'll just equip. Otherwise, it lets you pick which outfit!
var/list/ctf_gear = list("white" = /datum/outfit/ctf)
var/instagib_gear = /datum/outfit/ctf/instagib
var/ammo_type = /obj/effect/ctf/ammo
var/ammo_type = /obj/effect/powerup/ammo/ctf
// Fast paced gameplay, no real time for burn infections.
var/player_traits = list(TRAIT_NEVER_WOUNDED)
@@ -670,45 +668,6 @@
alpha = 100
resistance_flags = INDESTRUCTIBLE
/obj/effect/ctf/ammo
name = "ammo pickup"
desc = "You like revenge, right? Everybody likes revenge! Well, \
let's go get some!"
icon = 'icons/effects/effects.dmi'
icon_state = "at_shield1"
layer = ABOVE_MOB_LAYER
alpha = 255
invisibility = 0
/obj/effect/ctf/ammo/Initialize(mapload)
..()
QDEL_IN(src, AMMO_DROP_LIFETIME)
/obj/effect/ctf/ammo/Crossed(atom/movable/AM)
. = ..()
reload(AM)
/obj/effect/ctf/ammo/Bump(atom/A)
reload(A)
/obj/effect/ctf/ammo/Bumped(atom/movable/AM)
reload(AM)
/obj/effect/ctf/ammo/proc/reload(mob/living/M)
if(!ishuman(M))
return
for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines)
if(M in CTF.spawned_mobs)
var/outfit = CTF.spawned_mobs[M]
var/datum/outfit/O = new outfit
for(var/obj/item/gun/G in M)
qdel(G)
O.equip(M)
to_chat(M, "<span class='notice'>Ammunition reloaded!</span>")
playsound(get_turf(M), 'sound/weapons/gun/shotgun/rack.ogg', 50, TRUE, -1)
qdel(src)
break
/obj/effect/ctf/dead_barricade
name = "dead barrier"
desc = "It provided cover in fire fights. And now it's gone."
@@ -774,5 +733,4 @@
#undef FLAG_RETURN_TIME
#undef INSTAGIB_RESPAWN
#undef DEFAULT_RESPAWN
#undef AMMO_DROP_LIFETIME
#undef CTF_REQUIRED_PLAYERS
@@ -1075,12 +1075,11 @@
/obj/item/mayhem/attack_self(mob/user)
for(var/mob/living/carbon/human/H in range(7,user))
var/obj/effect/mine/pickup/bloodbath/B = new(H)
INVOKE_ASYNC(B, /obj/effect/mine/pickup/bloodbath/.proc/mineEffect, H)
H.apply_status_effect(STATUS_EFFECT_MAYHEM)
to_chat(user, "<span class='notice'>You shatter the bottle!</span>")
playsound(user.loc, 'sound/effects/glassbr1.ogg', 100, TRUE)
message_admins("<span class='adminnotice'>[ADMIN_LOOKUPFLW(user)] has activated a bottle of mayhem!</span>")
log_combat(user, null, "activated a bottle of mayhem", src)
user.log_message("activated a bottle of mayhem", LOG_ATTACK)
qdel(src)
//Colossus
@@ -124,6 +124,7 @@
else
chamber_round(replace_new_round = TRUE)
update_icon()
RegisterSignal(src, COMSIG_ITEM_RECHARGED, .proc/instant_reload)
/obj/item/gun/ballistic/vv_edit_var(vname, vval)
. = ..()
@@ -612,6 +613,15 @@ GLOBAL_LIST_INIT(gun_saw_types, typecacheof(list(
process_fire(user, user, FALSE)
. = TRUE
/obj/item/gun/ballistic/proc/instant_reload()
if(magazine)
magazine.top_off()
else
if(!mag_type)
return
magazine = new mag_type(src)
chamber_round()
update_icon()
/obj/item/suppressor
name = "suppressor"
+8
View File
@@ -44,6 +44,7 @@
if(selfcharge)
START_PROCESSING(SSobj, src)
update_icon()
RegisterSignal(src, COMSIG_ITEM_RECHARGED, .proc/instant_recharge)
/obj/item/gun/energy/ComponentInitialize()
. = ..()
@@ -243,3 +244,10 @@
playsound(user, BB.hitsound, 50, TRUE)
cell.use(E.e_cost)
. = "<span class='danger'>[user] casually lights [A.loc == user ? "[user.p_their()] [A.name]" : A] with [src]. Damn.</span>"
/obj/item/gun/energy/proc/instant_recharge()
if(!cell)
return
cell.charge = cell.maxcharge
recharge_newshot(no_cyborg_drain = TRUE)
update_icon()
+6
View File
@@ -54,6 +54,7 @@
chambered = new ammo_type(src)
if(can_charge)
START_PROCESSING(SSobj, src)
RegisterSignal(src, COMSIG_ITEM_RECHARGED, .proc/instant_recharge)
/obj/item/gun/magic/Destroy()
@@ -89,3 +90,8 @@
switch(var_name)
if(NAMEOF(src, charges))
recharge_newshot()
/obj/item/gun/magic/proc/instant_recharge()
charges = max_charges
recharge_newshot()
update_icon()