mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
polishing
This commit is contained in:
@@ -98,23 +98,25 @@ obj/machinery/recharger/process()
|
||||
if(charging)
|
||||
if(istype(charging, /obj/item/weapon/gun/energy))
|
||||
var/obj/item/weapon/gun/energy/E = charging
|
||||
if(E.power_supply.charge < E.power_supply.maxcharge)
|
||||
if((E.power_supply.charge + 100) < E.power_supply.maxcharge)
|
||||
E.power_supply.give(100)
|
||||
icon_state = "recharger1"
|
||||
use_power(250)
|
||||
update_icon()
|
||||
else
|
||||
E.power_supply.charge = E.power_supply.maxcharge
|
||||
update_icon()
|
||||
icon_state = "recharger2"
|
||||
return
|
||||
else if(istype(charging, /obj/item/energy_magazine))//pulse bullet casings
|
||||
var/obj/item/energy_magazine/M = charging
|
||||
if(M.bullets < M.max_bullets)
|
||||
if((M.bullets + 3) < M.max_bullets)
|
||||
M.bullets = min(M.max_bullets,M.bullets+3)
|
||||
icon_state = "recharger1"
|
||||
use_power(250)
|
||||
update_icon()
|
||||
else
|
||||
M.bullets = M.max_bullets
|
||||
update_icon()
|
||||
icon_state = "recharger2"
|
||||
return
|
||||
@@ -147,12 +149,12 @@ obj/machinery/recharger/emp_act(severity)
|
||||
|
||||
obj/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier.
|
||||
if(charging)
|
||||
overlays = 0
|
||||
overlays.len = 0
|
||||
charging.update_icon()
|
||||
overlays += charging.appearance
|
||||
icon_state = "recharger1"
|
||||
else
|
||||
overlays = 0
|
||||
overlays.len = 0
|
||||
icon_state = "recharger0"
|
||||
|
||||
obj/machinery/recharger/wallcharger
|
||||
|
||||
@@ -50,7 +50,7 @@ obj/item/weapon/gun/energy/laser/retro
|
||||
item_state = null
|
||||
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/guninhands_left.dmi', "right_hand" = 'icons/mob/in-hand/right/guninhands_right.dmi')
|
||||
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
|
||||
|
||||
projectile_type = /obj/item/projectile/beam/retro
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain
|
||||
icon_state = "caplaser"
|
||||
|
||||
@@ -266,17 +266,16 @@ var/list/impact_master = list()
|
||||
for(var/mob/M in A)
|
||||
M.bullet_act(src, def_zone)
|
||||
|
||||
if(bounces || phases)
|
||||
//the bullets first checks if it can bounce off the obstacle, and if it cannot it then checks if it can phase through it, if it cannot either then it dies.
|
||||
var/reaction_type = A.projectile_check()
|
||||
if(bounces && (bounce_type & reaction_type))
|
||||
rebound(A)
|
||||
bounces--
|
||||
return 1
|
||||
else if(phases && (phase_type & reaction_type))
|
||||
src.forceMove(get_step(src.loc,dir))
|
||||
phases--
|
||||
return 1
|
||||
//the bullets first checks if it can bounce off the obstacle, and if it cannot it then checks if it can phase through it, if it cannot either then it dies.
|
||||
var/reaction_type = A.projectile_check()
|
||||
if(bounces && (bounce_type & reaction_type))
|
||||
rebound(A)
|
||||
bounces--
|
||||
return 1
|
||||
else if(phases && (phase_type & reaction_type))
|
||||
src.forceMove(get_step(src.loc,dir))
|
||||
phases--
|
||||
return 1
|
||||
|
||||
bullet_die()
|
||||
return 1
|
||||
|
||||
@@ -15,6 +15,10 @@ var/list/beam_master = list()
|
||||
/obj/item/projectile/beam/captain
|
||||
name = "captain laser"
|
||||
damage = 40
|
||||
linear_movement = 0
|
||||
|
||||
/obj/item/projectile/beam/retro
|
||||
linear_movement = 0
|
||||
|
||||
/obj/item/projectile/beam/lightning
|
||||
invisibility = 101
|
||||
@@ -217,7 +221,7 @@ var/list/beam_master = list()
|
||||
icon_state = "laser"
|
||||
invisibility = 101
|
||||
animate_movement = 2
|
||||
linear_movement = 0
|
||||
linear_movement = 1
|
||||
layer = 13
|
||||
|
||||
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
||||
@@ -227,8 +231,34 @@ var/list/beam_master = list()
|
||||
eyeblur = 4
|
||||
var/frequency = 1
|
||||
|
||||
/obj/item/projectile/beam/OnFired()
|
||||
return ..()
|
||||
/obj/item/projectile/beam/OnFired() //if assigned, allows for code when the projectile gets fired
|
||||
target = get_turf(original)
|
||||
dist_x = abs(target.x - starting.x)
|
||||
dist_y = abs(target.y - starting.y)
|
||||
|
||||
override_starting_X = starting.x
|
||||
override_starting_Y = starting.y
|
||||
override_target_X = target.x
|
||||
override_target_Y = target.y
|
||||
|
||||
if (target.x > starting.x)
|
||||
dx = EAST
|
||||
else
|
||||
dx = WEST
|
||||
|
||||
if (target.y > starting.y)
|
||||
dy = NORTH
|
||||
else
|
||||
dy = SOUTH
|
||||
|
||||
if(dist_x > dist_y)
|
||||
error = dist_x/2 - dist_y
|
||||
else
|
||||
error = dist_y/2 - dist_x
|
||||
|
||||
target_angle = round(Get_Angle(starting,target))
|
||||
|
||||
return 1
|
||||
|
||||
/obj/item/projectile/beam/process()
|
||||
var/lastposition = loc
|
||||
@@ -294,32 +324,56 @@ var/list/beam_master = list()
|
||||
if(bump_original_check())
|
||||
return reference
|
||||
|
||||
update_pixel()
|
||||
if(linear_movement)
|
||||
update_pixel()
|
||||
|
||||
//If the icon has not been added yet
|
||||
if( !("[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]" in beam_master) )
|
||||
var/image/I = image(icon,"[icon_state]_pixel",13,target_dir) //Generate it.
|
||||
I.transform = turn(I.transform, target_angle+45)
|
||||
I.pixel_x = PixelX
|
||||
I.pixel_y = PixelY
|
||||
beam_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = I //And cache it!
|
||||
//If the icon has not been added yet
|
||||
if( !("[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]" in beam_master) )
|
||||
var/image/I = image(icon,"[icon_state]_pixel",13,target_dir) //Generate it.
|
||||
I.transform = turn(I.transform, target_angle+45)
|
||||
I.pixel_x = PixelX
|
||||
I.pixel_y = PixelY
|
||||
beam_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = I //And cache it!
|
||||
|
||||
//Finally add the overlay
|
||||
if(src.loc && target_dir)
|
||||
src.loc.overlays += beam_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"]
|
||||
//Finally add the overlay
|
||||
if(src.loc && target_dir)
|
||||
src.loc.overlays += beam_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"]
|
||||
|
||||
//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]_angle[target_angle]_pX[PixelX]_pY[PixelY]" in turf_master)
|
||||
var/list/turfs = turf_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"]
|
||||
turfs += loc
|
||||
//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]_angle[target_angle]_pX[PixelX]_pY[PixelY]" in turf_master)
|
||||
var/list/turfs = turf_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"]
|
||||
turfs += loc
|
||||
else
|
||||
turf_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = list(loc)
|
||||
else
|
||||
turf_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = list(loc)
|
||||
else
|
||||
var/list/turfs = list()
|
||||
turfs["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = list(loc)
|
||||
beam_master[reference] = turfs
|
||||
var/list/turfs = list()
|
||||
turfs["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = list(loc)
|
||||
beam_master[reference] = turfs
|
||||
else
|
||||
//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
|
||||
if(src.loc && target_dir)
|
||||
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
|
||||
|
||||
|
||||
return reference
|
||||
|
||||
|
||||
@@ -416,6 +416,7 @@
|
||||
icon = 'icons/obj/lightning.dmi'
|
||||
icon_state = "heatray"
|
||||
animate_movement = 0
|
||||
linear_movement = 0
|
||||
pass_flags = PASSTABLE
|
||||
var/drawn = 0
|
||||
var/tang = 0
|
||||
|
||||
Reference in New Issue
Block a user