Proted instabeams for energy projectiles.

Also buffed laser damage to pre-merge.
This commit is contained in:
Chinsky
2012-11-06 20:35:48 +04:00
parent 4a9c7b82ae
commit 1a02f2ff1c
9 changed files with 96 additions and 26 deletions

View File

@@ -820,14 +820,14 @@ Auto Patrol: []"},
projectile = /obj/item/projectile/energy/electrode projectile = /obj/item/projectile/energy/electrode
else if(lasercolor == "b") else if(lasercolor == "b")
if (src.emagged == 2) if (src.emagged == 2)
projectile = /obj/item/projectile/omnitag projectile = /obj/item/projectile/beam/omnitag
else else
projectile = /obj/item/projectile/bluetag projectile = /obj/item/projectile/beam/bluetag
else if(lasercolor == "r") else if(lasercolor == "r")
if (src.emagged == 2) if (src.emagged == 2)
projectile = /obj/item/projectile/omnitag projectile = /obj/item/projectile/beam/omnitag
else else
projectile = /obj/item/projectile/redtag projectile = /obj/item/projectile/beam/redtag
if (!( istype(U, /turf) )) if (!( istype(U, /turf) ))
return return
@@ -1011,7 +1011,7 @@ Auto Patrol: []"},
/obj/machinery/bot/ed209/bullet_act(var/obj/item/projectile/Proj) /obj/machinery/bot/ed209/bullet_act(var/obj/item/projectile/Proj)
if((src.lasercolor == "b") && (src.disabled == 0)) if((src.lasercolor == "b") && (src.disabled == 0))
if(istype(Proj, /obj/item/projectile/redtag)) if(istype(Proj, /obj/item/projectile/beam/redtag))
src.disabled = 1 src.disabled = 1
del (Proj) del (Proj)
sleep(100) sleep(100)
@@ -1019,7 +1019,7 @@ Auto Patrol: []"},
else else
..() ..()
else if((src.lasercolor == "r") && (src.disabled == 0)) else if((src.lasercolor == "r") && (src.disabled == 0))
if(istype(Proj, /obj/item/projectile/bluetag)) if(istype(Proj, /obj/item/projectile/beam/bluetag))
src.disabled = 1 src.disabled = 1
del (Proj) del (Proj)
sleep(100) sleep(100)

View File

@@ -76,8 +76,8 @@
// All energy-based weapons are applicable // All energy-based weapons are applicable
switch(E.type) switch(E.type)
if(/obj/item/weapon/gun/energy/laser/bluetag) if(/obj/item/weapon/gun/energy/laser/bluetag)
projectile = /obj/item/projectile/bluetag projectile = /obj/item/projectile/beam/bluetag
eprojectile = /obj/item/projectile/omnitag//This bolt will stun ERRYONE with a vest eprojectile = /obj/item/projectile/beam/omnitag//This bolt will stun ERRYONE with a vest
iconholder = null iconholder = null
reqpower = 100 reqpower = 100
lasercolor = "b" lasercolor = "b"
@@ -90,8 +90,8 @@
shot_delay = 30 shot_delay = 30
if(/obj/item/weapon/gun/energy/laser/redtag) if(/obj/item/weapon/gun/energy/laser/redtag)
projectile = /obj/item/projectile/redtag projectile = /obj/item/projectile/beam/redtag
eprojectile = /obj/item/projectile/omnitag eprojectile = /obj/item/projectile/beam/omnitag
iconholder = null iconholder = null
reqpower = 100 reqpower = 100
lasercolor = "r" lasercolor = "r"
@@ -104,7 +104,7 @@
shot_delay = 30 shot_delay = 30
if(/obj/item/weapon/gun/energy/laser/practice) if(/obj/item/weapon/gun/energy/laser/practice)
projectile = /obj/item/projectile/practice projectile = /obj/item/projectile/beam/practice
eprojectile = /obj/item/projectile/beam eprojectile = /obj/item/projectile/beam
iconholder = null iconholder = null
reqpower = 100 reqpower = 100
@@ -375,13 +375,13 @@ Status: []<BR>"},
if (src.health <= 0) if (src.health <= 0)
src.die() // the death process :( src.die() // the death process :(
if((src.lasercolor == "b") && (src.disabled == 0)) if((src.lasercolor == "b") && (src.disabled == 0))
if(istype(Proj, /obj/item/projectile/redtag)) if(istype(Proj, /obj/item/projectile/beam/redtag))
src.disabled = 1 src.disabled = 1
del (Proj) del (Proj)
sleep(100) sleep(100)
src.disabled = 0 src.disabled = 0
if((src.lasercolor == "r") && (src.disabled == 0)) if((src.lasercolor == "r") && (src.disabled == 0))
if(istype(Proj, /obj/item/projectile/bluetag)) if(istype(Proj, /obj/item/projectile/beam/bluetag))
src.disabled = 1 src.disabled = 1
del (Proj) del (Proj)
sleep(100) sleep(100)

View File

@@ -221,9 +221,9 @@
if(4) if(4)
A = new /obj/item/projectile/change( loc ) A = new /obj/item/projectile/change( loc )
if(5) if(5)
A = new /obj/item/projectile/bluetag( loc ) A = new /obj/item/projectile/beam/bluetag( loc )
if(6) if(6)
A = new /obj/item/projectile/redtag( loc ) A = new /obj/item/projectile/beam/redtag( loc )
A.original = target.loc A.original = target.loc
use_power(500) use_power(500)
else else

View File

@@ -114,7 +114,7 @@
bmark.pixel_x-- bmark.pixel_x--
bmark.pixel_y-- bmark.pixel_y--
if(Proj.damage >= 20 || istype(Proj, /obj/item/projectile/practice)) if(Proj.damage >= 20 || istype(Proj, /obj/item/projectile/beam/practice))
bmark.icon_state = "scorch" bmark.icon_state = "scorch"
bmark.dir = pick(NORTH,SOUTH,EAST,WEST) // random scorch design bmark.dir = pick(NORTH,SOUTH,EAST,WEST) // random scorch design

View File

@@ -554,4 +554,8 @@
..() ..()
return return
/obj/item/weapon/storage/pill_bottle/New()
pixel_x = rand (-7,7)
pixel_y = rand (-7,7)
..()
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@@ -90,7 +90,7 @@ obj/item/weapon/gun/energy/laser/retro
name = "laser tag gun" name = "laser tag gun"
icon_state = "bluetag" icon_state = "bluetag"
desc = "Standard issue weapon of the Imperial Guard" desc = "Standard issue weapon of the Imperial Guard"
projectile_type = "/obj/item/projectile/bluetag" projectile_type = "/obj/item/projectile/beam/bluetag"
origin_tech = "combat=1;magnets=2" origin_tech = "combat=1;magnets=2"
clumsy_check = 0 clumsy_check = 0
var/charge_tick = 0 var/charge_tick = 0
@@ -127,7 +127,7 @@ obj/item/weapon/gun/energy/laser/retro
name = "laser tag gun" name = "laser tag gun"
icon_state = "redtag" icon_state = "redtag"
desc = "Standard issue weapon of the Imperial Guard" desc = "Standard issue weapon of the Imperial Guard"
projectile_type = "/obj/item/projectile/redtag" projectile_type = "/obj/item/projectile/beam/redtag"
origin_tech = "combat=1;magnets=2" origin_tech = "combat=1;magnets=2"
clumsy_check = 0 clumsy_check = 0
var/charge_tick = 0 var/charge_tick = 0

View File

@@ -1,14 +1,80 @@
var/list/beam_master = list()
//Use: Caches beam state images and holds turfs that had these images overlaid.
//Structure:
//beam_master
// icon_states/dirs of beams
// image for that beam
// references for fired beams
// icon_states/dirs for each placed beam image
// turfs that have that icon_state/dir
/obj/item/projectile/beam /obj/item/projectile/beam
name = "laser" name = "laser"
icon_state = "laser" icon_state = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 20 damage = 40
damage_type = BURN damage_type = BURN
flag = "laser" flag = "laser"
eyeblur = 2 eyeblur = 4
var/frequency = 1 var/frequency = 1
process()
var/reference = "\ref[src]" //So we do not have to recalculate it a ton
var/first = 1 //So we don't make the overlay in the same tile as the firer
/obj/item/projectile/practice spawn(0)
while(!bumped) //Move until we hit something
step_towards(src, current) //Move~
for(var/mob/living/M in loc)
Bump(M) //Bump anyone we touch
if((!( current ) || loc == current)) //If we pass our target
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
del(src) //Delete if it passes the world edge
return
if(!first) //Add the overlay as we pass over tiles
var/target_dir = get_dir(src, current) //So we don't call this too much
//If the icon has not been added yet
if( !("[icon_state][target_dir]" in beam_master) )
var/image/I = image(icon,icon_state,10,target_dir) //Generate it.
beam_master["[icon_state][target_dir]"] = I //And cache it!
//Finally add the overlay
src.loc.overlays += beam_master["[icon_state][target_dir]"]
//Add the turf to a list in the beam master so they can be cleaned up easily.
if(reference in beam_master)
var/list/turf_master = beam_master[reference]
if("[icon_state][target_dir]" in turf_master)
var/list/turfs = turf_master["[icon_state][target_dir]"]
turfs += loc
else
turf_master["[icon_state][target_dir]"] = list(loc)
else
var/list/turfs = list()
turfs["[icon_state][target_dir]"] = list(loc)
beam_master[reference] = turfs
else
first = 0
cleanup(reference)
return
proc/cleanup(reference) //Waits .3 seconds then removes the overlay.
src = null
sleep(3)
var/list/turf_master = beam_master[reference]
for(var/laser_state in turf_master)
var/list/turfs = turf_master[laser_state]
for(var/turf/T in turfs)
T.overlays -= beam_master[laser_state]
return
/obj/item/projectile/beam/practice
name = "laser" name = "laser"
icon_state = "laser" icon_state = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
@@ -45,7 +111,7 @@
/obj/item/projectile/bluetag /obj/item/projectile/beam/bluetag
name = "lasertag beam" name = "lasertag beam"
icon_state = "bluelaser" icon_state = "bluelaser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
@@ -60,7 +126,7 @@
M.Weaken(5) M.Weaken(5)
return 1 return 1
/obj/item/projectile/redtag /obj/item/projectile/beam/redtag
name = "lasertag beam" name = "lasertag beam"
icon_state = "laser" icon_state = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
@@ -75,7 +141,7 @@
M.Weaken(5) M.Weaken(5)
return 1 return 1
/obj/item/projectile/omnitag//A laser tag bolt that stuns EVERYONE /obj/item/projectile/beam/omnitag//A laser tag bolt that stuns EVERYONE
name = "lasertag beam" name = "lasertag beam"
icon_state = "omnilaser" icon_state = "omnilaser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE

View File

@@ -153,8 +153,8 @@
if(istype(P,/obj/item/projectile/beam)) src.Artifact_Activate() if(istype(P,/obj/item/projectile/beam)) src.Artifact_Activate()
else if(istype(P,/obj/item/projectile/ion)) src.Artifact_Activate() else if(istype(P,/obj/item/projectile/ion)) src.Artifact_Activate()
else if(istype(P,/obj/item/projectile/energy)) src.Artifact_Activate() else if(istype(P,/obj/item/projectile/energy)) src.Artifact_Activate()
else if(istype(P,/obj/item/projectile/bluetag)) src.Artifact_Activate() else if(istype(P,/obj/item/projectile/beam/bluetag)) src.Artifact_Activate()
else if(istype(P,/obj/item/projectile/redtag)) src.Artifact_Activate() else if(istype(P,/obj/item/projectile/beam/redtag)) src.Artifact_Activate()
if (my_effect.trigger == "heat") if (my_effect.trigger == "heat")
if(istype(P,/obj/item/projectile/temp)) src.Artifact_Activate() if(istype(P,/obj/item/projectile/temp)) src.Artifact_Activate()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 25 KiB