Fix spacepod weapons

I HATE BYOND
This commit is contained in:
Exxion
2015-03-04 05:58:01 -05:00
parent d5de3c2896
commit 5b3c256218
3 changed files with 31 additions and 20 deletions

View File

@@ -7,39 +7,41 @@
var/turf/secondloc
if(!my_atom.equipment_system || !my_atom.equipment_system.weapon_system)
usr << "<span class='warning'>Missing equipment or weapons.</span>"
my_atom.verbs -= text2path("[type]/proc/fire_weapons")
my_atom.verbs -= text2path("[type]/proc/fire_weapon_system")
return
my_atom.battery.use(shot_cost)
var/olddir
dir = my_atom.dir
for(var/i = 0; i < shots_per; i++)
if(olddir != dir)
switch(dir)
if(NORTH)
firstloc = get_step(src, NORTH)
firstloc = get_turf(my_atom)
firstloc = get_step(firstloc, NORTH)
secondloc = get_step(firstloc,EAST)
if(SOUTH)
firstloc = get_turf(src)
firstloc = get_turf(my_atom)
secondloc = get_step(firstloc,EAST)
if(EAST)
firstloc = get_turf(src)
firstloc = get_turf(my_atom)
firstloc = get_step(firstloc, EAST)
secondloc = get_step(firstloc,NORTH)
if(WEST)
firstloc = get_turf(src)
firstloc = get_turf(my_atom)
secondloc = get_step(firstloc,NORTH)
olddir = dir
var/obj/item/projectile/projone = new projectile_type(firstloc)
var/obj/item/projectile/projtwo = new projectile_type(secondloc)
projone.starting = get_turf(src)
projone.shot_from = src
projone.starting = get_turf(firstloc)
projone.shot_from = my_atom
projone.firer = usr
projone.def_zone = "chest"
projtwo.starting = get_turf(src)
projtwo.shot_from = src
projtwo.starting = get_turf(secondloc)
projtwo.shot_from = my_atom
projtwo.firer = usr
projtwo.def_zone = "chest"
spawn()
playsound(src, fire_sound, 50, 1)
spawn(0)
playsound(my_atom, fire_sound, 50, 1)
projone.dumbfire(dir)
projtwo.dumbfire(dir)
sleep(1)
@@ -76,7 +78,7 @@
name = "\improper taser system"
desc = "A weak taser system for space pods, fires electrodes that shock upon impact."
icon_state = "pod_taser"
projectile_type = "/obj/item/projectile/energy/electrode"
projectile_type = /obj/item/projectile/energy/electrode
shot_cost = 10
fire_sound = "sound/weapons/Taser.ogg"
@@ -85,8 +87,8 @@
set name = "Fire Taser System"
set desc = "Fire ze tasers!"
set src = usr.loc
src.fire_weapons()
var/obj/spacepod/S = src
S.equipment_system.weapon_system.fire_weapons()
/obj/item/device/spacepod_equipment/weaponry/taser/burst
name = "\improper burst taser system"
@@ -95,11 +97,19 @@
shot_cost = 20
shots_per = 3
/obj/item/device/spacepod_equipment/weaponry/taser/burst/proc/fire_weapons_system()
set category = "Spacepod"
set name = "Fire Burst Taser System"
set desc = "Fire ze tasers!"
set src = usr.loc
var/obj/spacepod/S = src
S.equipment_system.weapon_system.fire_weapons()
/obj/item/device/spacepod_equipment/weaponry/laser
name = "\improper laser system"
desc = "A weak laser system for space pods, fires concentrated bursts of energy"
icon_state = "pod_w_laser"
projectile_type = "/obj/item/projectile/beam"
projectile_type = /obj/item/projectile/beam
shot_cost = 15
fire_sound = 'sound/weapons/Laser.ogg'
fire_delay = 25
@@ -109,5 +119,5 @@
set name = "Fire Laser System"
set desc = "Fire ze lasers!"
set src = usr.loc
src.fire_weapons()
var/obj/spacepod/S = src
S.equipment_system.weapon_system.fire_weapons()

View File

@@ -176,6 +176,7 @@
user << "<span class='notice'>You remove \the [SPE] from the equipment system.</span>"
SPE.my_atom = null
equipment_system.weapon_system = null
verbs -= text2path("[SPE.type]/proc/fire_weapon_system")
else
user << "<span class='warning'>You need an open hand to do that.</span>"
/*
@@ -474,4 +475,4 @@
..()
#undef DAMAGE
#undef FIRE
#undef FIRE

View File

@@ -251,7 +251,7 @@ var/list/beam_master = list()
var/reference = "\ref[src]" // So we do not have to recalculate it a ton.
spawn(0)
var/target_dir = src.dir // TODO: remove dir arg.
var/target_dir = dir ? dir : src.dir// TODO: remove dir arg. Or don't because the way this was set up without it broke spacepods.
while(loc) // Move until we hit something.
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
@@ -388,4 +388,4 @@ var/list/beam_master = list()
var/mob/living/carbon/human/M = target
if((istype(M.wear_suit, /obj/item/clothing/suit/bluetag))||(istype(M.wear_suit, /obj/item/clothing/suit/redtag)))
M.Weaken(5)
return 1
return 1