mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Conflicts: baystation12.dme code/__HELPERS/global_lists.dm code/__HELPERS/type2type.dm code/__HELPERS/unsorted.dm code/datums/datumvars.dm code/datums/disease.dm code/datums/organs/organ_external.dm code/datums/supplypacks.dm code/defines/obj.dm code/game/area/areas.dm code/game/atoms.dm code/game/gamemodes/cult/cult_structures.dm code/game/gamemodes/cult/runes.dm code/game/gamemodes/events.dm code/game/gamemodes/events/ninja_equipment.dm code/game/gamemodes/events/space_ninja.dm code/game/gamemodes/game_mode.dm code/game/gamemodes/gameticker.dm code/game/hud.dm code/game/jobs/access.dm code/game/jobs/job/civilian.dm code/game/machinery/alarm.dm code/game/machinery/cloning.dm code/game/machinery/computer/cloning.dm code/game/machinery/computer/medical.dm code/game/machinery/computer/syndicate_shuttle.dm code/game/machinery/telecomms/broadcaster.dm code/game/machinery/telecomms/machine_interactions.dm code/game/objects/effects/decals/contraband.dm code/game/objects/effects/signs.dm code/game/objects/items/devices/PDA/PDA.dm code/game/objects/items/devices/PDA/cart.dm code/game/objects/items/weapons/photography.dm code/game/objects/structures/door_assembly.dm code/game/objects/structures/window.dm code/game/sound.dm code/game/verbs/ooc.dm code/global.dm code/modules/DetectiveWork/detective_work.dm code/modules/DetectiveWork/evidence.dm code/modules/DetectiveWork/footprints_and_rag.dm code/modules/DetectiveWork/scanner.dm code/modules/admin/player_panel.dm code/modules/admin/verbs/adminhelp.dm code/modules/admin/verbs/adminpm.dm code/modules/awaymissions/gateway.dm code/modules/client/client defines.dm code/modules/client/client procs.dm code/modules/client/preferences.dm code/modules/clothing/spacesuits/rig.dm code/modules/mining/machine_processing.dm code/modules/mining/machine_stacking.dm code/modules/mining/mint.dm code/modules/mining/ores_coins.dm code/modules/mining/satchel_ore_boxdm.dm code/modules/mob/living/carbon/alien/alien.dm code/modules/mob/living/carbon/carbon.dm code/modules/mob/living/carbon/carbon_defines.dm code/modules/mob/living/carbon/human/human_damage.dm code/modules/mob/living/carbon/human/life.dm code/modules/mob/living/carbon/human/update_icons.dm code/modules/mob/living/living.dm code/modules/mob/living/say.dm code/modules/mob/mob.dm code/modules/mob/mob_cleanup.dm code/modules/mob/mob_defines.dm code/modules/mob/mob_transformation_simple.dm code/modules/mob/new_player/login.dm code/modules/mob/new_player/new_player.dm code/modules/mob/new_player/preferences_setup.dm code/modules/mob/new_player/savefile.dm code/modules/mob/new_player/sprite_accessories.dm code/modules/paperwork/folders.dm code/modules/paperwork/paper.dm code/modules/paperwork/photocopier.dm code/modules/projectiles/guns/energy/special.dm code/modules/projectiles/guns/projectile/automatic.dm code/setup.dm code/unused/mining/datum_processing_recipe.dm code/unused/powerarmor/powerarmor.dm code/world.dm html/changelog.html icons/effects/96x96.dmi icons/mob/head.dmi icons/mob/items_lefthand.dmi icons/mob/items_righthand.dmi icons/mob/suit.dmi icons/obj/clothing/hats.dmi icons/obj/clothing/suits.dmi icons/obj/hydroponics.dmi icons/obj/items.dmi icons/turf/areas.dmi icons/turf/walls.dmi maps/RandomZLevels/fileList.txt maps/RandomZLevels/spacebattle.dmm Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
157 lines
4.5 KiB
Plaintext
157 lines
4.5 KiB
Plaintext
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 = 40
|
|
damage_type = BURN
|
|
flag = "laser"
|
|
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
|
|
|
|
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
|
|
damage = 0
|
|
damage_type = BURN
|
|
flag = "laser"
|
|
eyeblur = 2
|
|
|
|
|
|
/obj/item/projectile/beam/heavylaser
|
|
name = "heavy laser"
|
|
icon_state = "heavylaser"
|
|
damage = 40
|
|
|
|
/obj/item/projectile/beam/xray
|
|
name = "xray beam"
|
|
icon_state = "xray"
|
|
damage = 30
|
|
|
|
/obj/item/projectile/beam/pulse
|
|
name = "pulse"
|
|
icon_state = "u_laser"
|
|
damage = 50
|
|
|
|
|
|
/obj/item/projectile/beam/deathlaser
|
|
name = "death laser"
|
|
icon_state = "heavylaser"
|
|
damage = 60
|
|
|
|
/obj/item/projectile/beam/emitter
|
|
name = "emitter beam"
|
|
icon_state = "emitter"
|
|
damage = 30
|
|
|
|
|
|
/obj/item/projectile/beam/lastertag/blue
|
|
name = "lasertag beam"
|
|
icon_state = "bluelaser"
|
|
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
|
damage = 0
|
|
damage_type = BURN
|
|
flag = "laser"
|
|
|
|
on_hit(var/atom/target, var/blocked = 0)
|
|
if(istype(target, /mob/living/carbon/human))
|
|
var/mob/living/carbon/human/M = target
|
|
if(istype(M.wear_suit, /obj/item/clothing/suit/redtag))
|
|
M.Weaken(5)
|
|
return 1
|
|
|
|
/obj/item/projectile/beam/lastertag/red
|
|
name = "lasertag beam"
|
|
icon_state = "laser"
|
|
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
|
damage = 0
|
|
damage_type = BURN
|
|
flag = "laser"
|
|
|
|
on_hit(var/atom/target, var/blocked = 0)
|
|
if(istype(target, /mob/living/carbon/human))
|
|
var/mob/living/carbon/human/M = target
|
|
if(istype(M.wear_suit, /obj/item/clothing/suit/bluetag))
|
|
M.Weaken(5)
|
|
return 1
|
|
|
|
/obj/item/projectile/beam/lastertag/omni//A laser tag bolt that stuns EVERYONE
|
|
name = "lasertag beam"
|
|
icon_state = "omnilaser"
|
|
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
|
damage = 0
|
|
damage_type = BURN
|
|
flag = "laser"
|
|
|
|
on_hit(var/atom/target, var/blocked = 0)
|
|
if(istype(target, /mob/living/carbon/human))
|
|
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 |