diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index 2c0cd9da7b..4fa8f095fe 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -820,14 +820,14 @@ Auto Patrol: []"}, projectile = /obj/item/projectile/energy/electrode else if(lasercolor == "b") if (src.emagged == 2) - projectile = /obj/item/projectile/omnitag + projectile = /obj/item/projectile/beam/omnitag else - projectile = /obj/item/projectile/bluetag + projectile = /obj/item/projectile/beam/bluetag else if(lasercolor == "r") if (src.emagged == 2) - projectile = /obj/item/projectile/omnitag + projectile = /obj/item/projectile/beam/omnitag else - projectile = /obj/item/projectile/redtag + projectile = /obj/item/projectile/beam/redtag if (!( istype(U, /turf) )) return @@ -1011,7 +1011,7 @@ Auto Patrol: []"}, /obj/machinery/bot/ed209/bullet_act(var/obj/item/projectile/Proj) 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 del (Proj) sleep(100) @@ -1019,7 +1019,7 @@ Auto Patrol: []"}, else ..() 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 del (Proj) sleep(100) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 77e5c7763c..7be13d3d1e 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -76,8 +76,8 @@ // All energy-based weapons are applicable switch(E.type) if(/obj/item/weapon/gun/energy/laser/bluetag) - projectile = /obj/item/projectile/bluetag - eprojectile = /obj/item/projectile/omnitag//This bolt will stun ERRYONE with a vest + projectile = /obj/item/projectile/beam/bluetag + eprojectile = /obj/item/projectile/beam/omnitag//This bolt will stun ERRYONE with a vest iconholder = null reqpower = 100 lasercolor = "b" @@ -90,8 +90,8 @@ shot_delay = 30 if(/obj/item/weapon/gun/energy/laser/redtag) - projectile = /obj/item/projectile/redtag - eprojectile = /obj/item/projectile/omnitag + projectile = /obj/item/projectile/beam/redtag + eprojectile = /obj/item/projectile/beam/omnitag iconholder = null reqpower = 100 lasercolor = "r" @@ -104,7 +104,7 @@ shot_delay = 30 if(/obj/item/weapon/gun/energy/laser/practice) - projectile = /obj/item/projectile/practice + projectile = /obj/item/projectile/beam/practice eprojectile = /obj/item/projectile/beam iconholder = null reqpower = 100 @@ -375,13 +375,13 @@ Status: []
"}, if (src.health <= 0) src.die() // the death process :( 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 del (Proj) sleep(100) 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 del (Proj) sleep(100) diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index 2bf3020782..990b823ef1 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -221,9 +221,9 @@ if(4) A = new /obj/item/projectile/change( loc ) if(5) - A = new /obj/item/projectile/bluetag( loc ) + A = new /obj/item/projectile/beam/bluetag( loc ) if(6) - A = new /obj/item/projectile/redtag( loc ) + A = new /obj/item/projectile/beam/redtag( loc ) A.original = target.loc use_power(500) else diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index 94310b70fb..dce87fda31 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -114,7 +114,7 @@ bmark.pixel_x-- 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.dir = pick(NORTH,SOUTH,EAST,WEST) // random scorch design diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 59edfd3ebb..0fbebfdcbe 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -554,4 +554,8 @@ ..() return +/obj/item/weapon/storage/pill_bottle/New() + pixel_x = rand (-7,7) + pixel_y = rand (-7,7) + ..() //////////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 2f6cb028f5..bcb67e292e 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -90,7 +90,7 @@ obj/item/weapon/gun/energy/laser/retro name = "laser tag gun" icon_state = "bluetag" 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" clumsy_check = 0 var/charge_tick = 0 @@ -127,7 +127,7 @@ obj/item/weapon/gun/energy/laser/retro name = "laser tag gun" icon_state = "redtag" 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" clumsy_check = 0 var/charge_tick = 0 diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index e61af3b9cd..8f2d39bf9d 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -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 name = "laser" icon_state = "laser" pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE - damage = 20 + damage = 40 damage_type = BURN flag = "laser" - eyeblur = 2 + eyeblur = 4 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" icon_state = "laser" pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE @@ -45,7 +111,7 @@ -/obj/item/projectile/bluetag +/obj/item/projectile/beam/bluetag name = "lasertag beam" icon_state = "bluelaser" pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE @@ -60,7 +126,7 @@ M.Weaken(5) return 1 -/obj/item/projectile/redtag +/obj/item/projectile/beam/redtag name = "lasertag beam" icon_state = "laser" pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE @@ -75,7 +141,7 @@ M.Weaken(5) 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" icon_state = "omnilaser" pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE diff --git a/code/modules/research/xenoarchaeology/artifact.dm b/code/modules/research/xenoarchaeology/artifact.dm index 8c63e2667a..79c4b7c97c 100644 --- a/code/modules/research/xenoarchaeology/artifact.dm +++ b/code/modules/research/xenoarchaeology/artifact.dm @@ -153,8 +153,8 @@ 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/energy)) src.Artifact_Activate() - else if(istype(P,/obj/item/projectile/bluetag)) src.Artifact_Activate() - else if(istype(P,/obj/item/projectile/redtag)) src.Artifact_Activate() + else if(istype(P,/obj/item/projectile/beam/bluetag)) src.Artifact_Activate() + else if(istype(P,/obj/item/projectile/beam/redtag)) src.Artifact_Activate() if (my_effect.trigger == "heat") if(istype(P,/obj/item/projectile/temp)) src.Artifact_Activate() diff --git a/icons/obj/projectiles.dmi b/icons/obj/projectiles.dmi index aa6a1a893a..308e139092 100644 Binary files a/icons/obj/projectiles.dmi and b/icons/obj/projectiles.dmi differ