polishing

This commit is contained in:
DeityLink
2015-08-10 01:05:04 +02:00
parent 92a84648e4
commit 182ef129d0
6 changed files with 98 additions and 42 deletions

View File

@@ -98,23 +98,25 @@ obj/machinery/recharger/process()
if(charging) if(charging)
if(istype(charging, /obj/item/weapon/gun/energy)) if(istype(charging, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/E = charging 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) E.power_supply.give(100)
icon_state = "recharger1" icon_state = "recharger1"
use_power(250) use_power(250)
update_icon() update_icon()
else else
E.power_supply.charge = E.power_supply.maxcharge
update_icon() update_icon()
icon_state = "recharger2" icon_state = "recharger2"
return return
else if(istype(charging, /obj/item/energy_magazine))//pulse bullet casings else if(istype(charging, /obj/item/energy_magazine))//pulse bullet casings
var/obj/item/energy_magazine/M = charging 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) M.bullets = min(M.max_bullets,M.bullets+3)
icon_state = "recharger1" icon_state = "recharger1"
use_power(250) use_power(250)
update_icon() update_icon()
else else
M.bullets = M.max_bullets
update_icon() update_icon()
icon_state = "recharger2" icon_state = "recharger2"
return 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. 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) if(charging)
overlays = 0 overlays.len = 0
charging.update_icon() charging.update_icon()
overlays += charging.appearance overlays += charging.appearance
icon_state = "recharger1" icon_state = "recharger1"
else else
overlays = 0 overlays.len = 0
icon_state = "recharger0" icon_state = "recharger0"
obj/machinery/recharger/wallcharger obj/machinery/recharger/wallcharger

View File

@@ -50,7 +50,7 @@ obj/item/weapon/gun/energy/laser/retro
item_state = null 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') 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." 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 /obj/item/weapon/gun/energy/laser/captain
icon_state = "caplaser" icon_state = "caplaser"

View File

@@ -266,17 +266,16 @@ var/list/impact_master = list()
for(var/mob/M in A) for(var/mob/M in A)
M.bullet_act(src, def_zone) 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.
//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()
var/reaction_type = A.projectile_check() if(bounces && (bounce_type & reaction_type))
if(bounces && (bounce_type & reaction_type)) rebound(A)
rebound(A) bounces--
bounces-- return 1
return 1 else if(phases && (phase_type & reaction_type))
else if(phases && (phase_type & reaction_type)) src.forceMove(get_step(src.loc,dir))
src.forceMove(get_step(src.loc,dir)) phases--
phases-- return 1
return 1
bullet_die() bullet_die()
return 1 return 1

View File

@@ -15,6 +15,10 @@ var/list/beam_master = list()
/obj/item/projectile/beam/captain /obj/item/projectile/beam/captain
name = "captain laser" name = "captain laser"
damage = 40 damage = 40
linear_movement = 0
/obj/item/projectile/beam/retro
linear_movement = 0
/obj/item/projectile/beam/lightning /obj/item/projectile/beam/lightning
invisibility = 101 invisibility = 101
@@ -217,7 +221,7 @@ var/list/beam_master = list()
icon_state = "laser" icon_state = "laser"
invisibility = 101 invisibility = 101
animate_movement = 2 animate_movement = 2
linear_movement = 0 linear_movement = 1
layer = 13 layer = 13
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
@@ -227,8 +231,34 @@ var/list/beam_master = list()
eyeblur = 4 eyeblur = 4
var/frequency = 1 var/frequency = 1
/obj/item/projectile/beam/OnFired() /obj/item/projectile/beam/OnFired() //if assigned, allows for code when the projectile gets fired
return ..() 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() /obj/item/projectile/beam/process()
var/lastposition = loc var/lastposition = loc
@@ -294,32 +324,56 @@ var/list/beam_master = list()
if(bump_original_check()) if(bump_original_check())
return reference return reference
update_pixel() if(linear_movement)
update_pixel()
//If the icon has not been added yet //If the icon has not been added yet
if( !("[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]" in beam_master) ) 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. var/image/I = image(icon,"[icon_state]_pixel",13,target_dir) //Generate it.
I.transform = turn(I.transform, target_angle+45) I.transform = turn(I.transform, target_angle+45)
I.pixel_x = PixelX I.pixel_x = PixelX
I.pixel_y = PixelY I.pixel_y = PixelY
beam_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = I //And cache it! beam_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = I //And cache it!
//Finally add the overlay //Finally add the overlay
if(src.loc && target_dir) if(src.loc && target_dir)
src.loc.overlays += beam_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] 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. //Add the turf to a list in the beam master so they can be cleaned up easily.
if(reference in beam_master) if(reference in beam_master)
var/list/turf_master = beam_master[reference] var/list/turf_master = beam_master[reference]
if("[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]" in turf_master) 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]"] var/list/turfs = turf_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"]
turfs += loc turfs += loc
else
turf_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = list(loc)
else else
turf_master["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = list(loc) var/list/turfs = list()
else turfs["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = list(loc)
var/list/turfs = list() beam_master[reference] = turfs
turfs["[icon_state]_angle[target_angle]_pX[PixelX]_pY[PixelY]"] = list(loc) else
beam_master[reference] = turfs //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 return reference

View File

@@ -416,6 +416,7 @@
icon = 'icons/obj/lightning.dmi' icon = 'icons/obj/lightning.dmi'
icon_state = "heatray" icon_state = "heatray"
animate_movement = 0 animate_movement = 0
linear_movement = 0
pass_flags = PASSTABLE pass_flags = PASSTABLE
var/drawn = 0 var/drawn = 0
var/tang = 0 var/tang = 0

View File

@@ -64,7 +64,7 @@ obj/item/weapon/gun/energy/laser/retro/sc_retro
name ="retro laser" name ="retro laser"
icon_state = "retro" icon_state = "retro"
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's security or military forces." desc = "An older model of the basic lasergun, no longer used by Nanotrasen's security or military forces."
projectile_type = "/obj/item/projectile/practice" projectile_type = "/obj/item/projectile/beam/practice"
clumsy_check = 0 //No sense in having a harmless gun blow up in the clowns face clumsy_check = 0 //No sense in having a harmless gun blow up in the clowns face
//Syndicate silenced pistol. This definition is not necessary, it's just habit. //Syndicate silenced pistol. This definition is not necessary, it's just habit.