Porting the twohanded component.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#define AMMO_DROP_LIFETIME 300
|
||||
#define CTF_REQUIRED_PLAYERS 4
|
||||
|
||||
/obj/item/twohanded/ctf
|
||||
/obj/item/ctf
|
||||
name = "banner"
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
icon_state = "banner"
|
||||
@@ -16,6 +16,7 @@
|
||||
righthand_file = 'icons/mob/inhands/equipment/banners_righthand.dmi'
|
||||
desc = "A banner with Nanotrasen's logo on it."
|
||||
slowdown = 2
|
||||
item_flags = SLOWS_WHILE_IN_HAND
|
||||
throw_speed = 0
|
||||
throw_range = 1
|
||||
force = 200
|
||||
@@ -28,16 +29,20 @@
|
||||
var/obj/effect/ctf/flag_reset/reset
|
||||
var/reset_path = /obj/effect/ctf/flag_reset
|
||||
|
||||
/obj/item/twohanded/ctf/Destroy()
|
||||
/obj/item/ctf/Destroy()
|
||||
QDEL_NULL(reset)
|
||||
return ..()
|
||||
|
||||
/obj/item/twohanded/ctf/Initialize()
|
||||
/obj/item/ctf/Initialize()
|
||||
. = ..()
|
||||
if(!reset)
|
||||
reset = new reset_path(get_turf(src))
|
||||
|
||||
/obj/item/twohanded/ctf/process()
|
||||
/obj/item/ctf/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/two_handed)
|
||||
|
||||
/obj/item/ctf/process()
|
||||
if(is_ctf_target(loc)) //don't reset from someone's hands.
|
||||
return PROCESS_KILL
|
||||
if(world.time > reset_cooldown)
|
||||
@@ -49,7 +54,7 @@
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
/obj/item/twohanded/ctf/attack_hand(mob/living/user)
|
||||
/obj/item/ctf/attack_hand(mob/living/user)
|
||||
if(!is_ctf_target(user) && !anyonecanpickup)
|
||||
to_chat(user, "Non players shouldn't be moving the flag!")
|
||||
return
|
||||
@@ -73,7 +78,7 @@
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
..()
|
||||
|
||||
/obj/item/twohanded/ctf/dropped(mob/user)
|
||||
/obj/item/ctf/dropped(mob/user)
|
||||
..()
|
||||
user.anchored = FALSE
|
||||
user.status_flags |= CANPUSH
|
||||
@@ -86,7 +91,7 @@
|
||||
anchored = TRUE
|
||||
|
||||
|
||||
/obj/item/twohanded/ctf/red
|
||||
/obj/item/ctf/red
|
||||
name = "red flag"
|
||||
icon_state = "banner-red"
|
||||
item_state = "banner-red"
|
||||
@@ -95,7 +100,7 @@
|
||||
reset_path = /obj/effect/ctf/flag_reset/red
|
||||
|
||||
|
||||
/obj/item/twohanded/ctf/blue
|
||||
/obj/item/ctf/blue
|
||||
name = "blue flag"
|
||||
icon_state = "banner-blue"
|
||||
item_state = "banner-blue"
|
||||
@@ -276,8 +281,8 @@
|
||||
attack_ghost(ghost)
|
||||
|
||||
/obj/machinery/capture_the_flag/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/twohanded/ctf))
|
||||
var/obj/item/twohanded/ctf/flag = I
|
||||
if(istype(I, /obj/item/ctf))
|
||||
var/obj/item/ctf/flag = I
|
||||
if(flag.team != src.team)
|
||||
user.transferItemToLoc(flag, get_turf(flag.reset), TRUE)
|
||||
points++
|
||||
@@ -294,7 +299,7 @@
|
||||
if(istype(mob_area, /area/ctf))
|
||||
to_chat(M, "<span class='narsie [team_span]'>[team] team wins!</span>")
|
||||
to_chat(M, "<span class='userdanger'>Teams have been cleared. Click on the machines to vote to begin another round.</span>")
|
||||
for(var/obj/item/twohanded/ctf/W in M)
|
||||
for(var/obj/item/ctf/W in M)
|
||||
M.dropItemToGround(W)
|
||||
M.dust()
|
||||
for(var/obj/machinery/control_point/control in GLOB.machines)
|
||||
@@ -335,7 +340,7 @@
|
||||
var/list/ctf_object_typecache = typecacheof(list(
|
||||
/obj/machinery,
|
||||
/obj/effect/ctf,
|
||||
/obj/item/twohanded/ctf
|
||||
/obj/item/ctf
|
||||
))
|
||||
for(var/atm in A)
|
||||
if (isturf(A) || ismob(A) || isarea(A))
|
||||
|
||||
@@ -661,5 +661,5 @@
|
||||
|
||||
/datum/outfit/lavaknight/captain
|
||||
name ="Cydonian Knight Captain"
|
||||
l_pocket = /obj/item/twohanded/dualsaber/hypereutactic
|
||||
l_pocket = /obj/item/dualsaber/hypereutactic
|
||||
id = /obj/item/card/id/knight/captain
|
||||
|
||||
@@ -519,11 +519,11 @@
|
||||
|
||||
/obj/effect/spawner/lootdrop/snowdin/dungeonheavy
|
||||
name = "dungeon heavy"
|
||||
loot = list(/obj/item/twohanded/singularityhammer = 25,
|
||||
/obj/item/twohanded/mjollnir = 10,
|
||||
/obj/item/twohanded/fireaxe = 25,
|
||||
loot = list(/obj/item/singularityhammer = 25,
|
||||
/obj/item/mjollnir = 10,
|
||||
/obj/item/fireaxe = 25,
|
||||
/obj/item/organ/brain/alien = 17,
|
||||
/obj/item/twohanded/dualsaber = 15,
|
||||
/obj/item/dualsaber = 15,
|
||||
/obj/item/organ/heart/demon = 7,
|
||||
/obj/item/gun/ballistic/automatic/c20r/unrestricted = 16,
|
||||
/obj/item/gun/magic/wand/resurrection/inert = 15,
|
||||
@@ -544,7 +544,7 @@
|
||||
loot = list(/obj/item/stack/sheet/mineral/snow{amount = 25} = 10,
|
||||
/obj/item/toy/snowball = 15,
|
||||
/obj/item/shovel = 10,
|
||||
/obj/item/twohanded/spear = 8,
|
||||
/obj/item/spear = 8,
|
||||
)
|
||||
|
||||
//special items//--
|
||||
|
||||
Reference in New Issue
Block a user