Projectile Laser Update

Lasers are now projectiles instead of instant beams. Fire delay removed,
damages adjusted accordingly.
This commit is contained in:
SamCroswell
2014-11-26 19:16:21 -05:00
parent 7e9f669f44
commit 8b16d394ed
21 changed files with 326 additions and 79 deletions
@@ -10,8 +10,6 @@ emp_act
/mob/living/carbon/human/bullet_act(var/obj/item/projectile/P, var/def_zone)
var/datum/organ/external/organ = get_organ(check_zone(def_zone))
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam))
if(check_reflect(def_zone)) // Checks if you've passed a reflection% check
visible_message("<span class='danger'>The [P.name] gets reflected by [src]!</span>", \
@@ -40,6 +38,7 @@ emp_act
//Shrapnel
if (P.damage_type == BRUTE)
var/datum/organ/external/organ = get_organ(check_zone(def_zone))
var/armor = getarmor_organ(organ, "bullet")
if((P.embed && prob(20 + max(P.damage - armor, -10))))
var/obj/item/weapon/shard/shrapnel/SP = new()
@@ -358,11 +357,11 @@ emp_act
zone = get_zone_with_miss_chance(zone, src, min(15*(distance-2), 0))
else
zone = get_zone_with_miss_chance(zone, src, 15)
/*
if(!zone)
visible_message("\blue \The [O] misses [src] narrowly!")
return
*/
O.throwing = 0 //it hit, so stop moving
if ((O.thrower != src) && check_shields(throw_damage, "[O]"))
+8 -7
View File
@@ -57,13 +57,14 @@
signaler.signal()
*/
//Stun Beams
/*
//Stun Beams -- These were commented out, making appropriate changes here. - Dave
if(istype(P, /obj/item/projectile/beam/stun) || istype(P, /obj/item/projectile/bullet/stunshot))
stun_effect_act(0, P.agony, def_zone, P)
src <<"\red You have been hit by [P]!"
del P
return
*/
//Armor
var/absorb = run_armor_check(def_zone, P.flag)
var/proj_sharp = is_sharp(P)
@@ -119,15 +120,15 @@
var/throw_damage = O.throwforce*(speed/5)
var/miss_chance = 15
//var/miss_chance = 15
if (O.throw_source)
var/distance = get_dist(O.throw_source, loc)
miss_chance = min(15*(distance-2), 0)
//miss_chance = min(15*(distance-2), 0)
/*
if (prob(miss_chance))
visible_message("\blue \The [O] misses [src] narrowly!")
return
*/
src.visible_message("\red [src] has been hit by [O].")
var/armor = run_armor_check(null, "melee")
@@ -168,7 +169,7 @@
visible_message("<span class='warning'>[src] is pinned to the wall by [O]!</span>","<span class='warning'>You are pinned to the wall by [O]!</span>")
src.anchored = 1
src.pinned += O
/mob/living/mech_melee_attack(obj/mecha/M)
if(M.occupant.a_intent == "harm")
if(M.damtype == "brute")
+3 -2
View File
@@ -30,7 +30,7 @@
var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
var/firerate = 1 // 0 for one bullet after tarrget moves and aim is lowered,
//1 for keep shooting until aim is lowered
var/fire_delay = 6
var/fire_delay = 0
var/last_fired = 0
proc/ready_to_fire()
@@ -154,6 +154,7 @@
in_chamber.current = curloc
in_chamber.yo = targloc.y - curloc.y
in_chamber.xo = targloc.x - curloc.x
if(istype(user, /mob/living/carbon))
var/mob/living/carbon/mob = user
if(mob.shock_stage > 120)
@@ -238,7 +239,7 @@
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
if(istype(in_chamber, /obj/item/projectile/beam/lastertag))
if(istype(in_chamber, /obj/item/projectile/lasertag))
user.show_message("<span class = 'warning'>You feel rather silly, trying to commit suicide with a toy.</span>")
mouthshoot = 0
return
@@ -12,7 +12,7 @@
/obj/item/weapon/gun/energy/laser/practice
name = "practice laser gun"
desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice."
projectile_type = "/obj/item/projectile/beam/practice"
projectile_type = "/obj/item/projectile/practice"
clumsy_check = 0
obj/item/weapon/gun/energy/laser/retro
@@ -58,7 +58,6 @@ obj/item/weapon/gun/energy/laser/retro
if(R && R.cell)
R.cell.use(500)
in_chamber = new/obj/item/projectile/beam(src)
fire_delay = 12
return 1
return 0
@@ -74,7 +73,6 @@ obj/item/weapon/gun/energy/laser/retro
origin_tech = "combat=4;materials=3;powerstorage=3"
projectile_type = "/obj/item/projectile/beam/heavylaser"
charge_cost = 1250
fire_delay = 10
isHandgun()
return 0
@@ -106,7 +104,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/beam/lastertag/blue"
projectile_type = "/obj/item/projectile/lastertag/blue"
origin_tech = "combat=1;magnets=2"
clumsy_check = 0
var/charge_tick = 0
@@ -143,7 +141,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/beam/lastertag/red"
projectile_type = "/obj/item/projectile/lastertag/red"
origin_tech = "combat=1;magnets=2"
clumsy_check = 0
var/charge_tick = 0
@@ -5,7 +5,7 @@
item_state = null //so the human update icon uses the icon_state instead.
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = "/obj/item/projectile/beam/stun"
projectile_type = "/obj/item/projectile/energy/electrode"
origin_tech = "combat=3;magnets=2"
modifystate = "energystun"
@@ -26,7 +26,7 @@
charge_cost = 1000
fire_sound = 'sound/weapons/Taser.ogg'
user << "\red [src.name] is now set to stun."
projectile_type = "/obj/item/projectile/beam/stun"
projectile_type = "/obj/item/projectile/energy/electrode"
modifystate = "energystun"
update_icon()
if(user.l_hand == src)
@@ -9,7 +9,6 @@
projectile_type = "/obj/item/projectile/beam/pulse"
cell_type = "/obj/item/weapon/cell/super"
var/mode = 2
fire_delay = 15
slot_flags = SLOT_BACK
w_class = 4.0
@@ -18,21 +17,18 @@
if(2)
mode = 0
charge_cost = 100
fire_delay = 5
fire_sound = 'sound/weapons/Taser.ogg'
user << "\red [src.name] is now set to stun."
projectile_type = "/obj/item/projectile/beam/stun"
projectile_type = "/obj/item/projectile/energy/electrode/revolver"
if(0)
mode = 1
charge_cost = 100
fire_delay = 8
fire_sound = 'sound/weapons/Laser.ogg'
user << "\red [src.name] is now set to kill."
projectile_type = "/obj/item/projectile/beam"
if(1)
mode = 2
charge_cost = 200
fire_delay = 15
fire_sound = 'sound/weapons/pulse.ogg'
user << "\red [src.name] is now set to DESTROY."
projectile_type = "/obj/item/projectile/beam/pulse"
@@ -179,7 +179,7 @@ obj/item/weapon/gun/energy/staff/focus
projectile_type = "/obj/item/projectile/beam/sniper"
slot_flags = SLOT_BACK
charge_cost = 2500
fire_delay = 35
fire_delay = 10
w_class = 4.0
var/zoom = 0
@@ -227,7 +227,6 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
projectile_type = "/obj/item/projectile/kinetic"
cell_type = "/obj/item/weapon/cell/crap"
charge_cost = 5000
fire_delay = 20
/obj/item/weapon/gun/energy/kinetic_accelerator/attack_self(var/mob/living/user/L)
power_supply.give(5000)
+5 -5
View File
@@ -5,7 +5,7 @@
icon_state = "taser"
item_state = null //so the human update icon uses the icon_state instead.
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = "/obj/item/projectile/beam/stun"
projectile_type = "/obj/item/projectile/energy/electrode"
cell_type = "/obj/item/weapon/cell"
/obj/item/weapon/gun/energy/taser/cyborg
@@ -13,7 +13,7 @@
desc = "A small, low capacity gun used for non-lethal takedowns."
icon_state = "taser"
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = "/obj/item/projectile/beam/stun"
projectile_type = "/obj/item/projectile/energy/electrode"
cell_type = "/obj/item/weapon/cell/secborg"
var/charge_tick = 0
var/recharge_time = 10 //Time it takes for shots to recharge (in ticks)
@@ -51,7 +51,7 @@
icon_state = "stunrevolver"
fire_sound = 'sound/weapons/Taser.ogg'
origin_tech = "combat=3;materials=3;powerstorage=2"
projectile_type = "/obj/item/projectile/energy/electroderevolver"
projectile_type = "/obj/item/projectile/energy/electrode/revolver"
cell_type = "/obj/item/weapon/cell"
@@ -88,11 +88,11 @@
/obj/item/weapon/gun/energy/crossbow/update_icon()
return
/obj/item/weapon/gun/energy/crossbow/cyborg/process()
..()
return
/obj/item/weapon/gun/energy/crossbow/cyborg/process_chambered()
if(in_chamber)
return 1
+20 -19
View File
@@ -109,30 +109,31 @@
f.hotspot_expose(1000,CELL_VOLUME)
else
def_zone = get_zone_with_miss_chance(def_zone, M, miss_modifier + 8*distance)
/*
if(!def_zone)
visible_message("\blue \The [src] misses [M] narrowly!")
forcedodge = -1
else
if(silenced)
playsound(loc, hitsound, 5, 1, -1)
M << "\red You've been shot in the [parse_zone(def_zone)] by the [src.name]!"
*/
if(silenced)
playsound(loc, hitsound, 5, 1, -1)
M << "\red You've been shot in the [parse_zone(def_zone)] by the [src.name]!"
else
playsound(loc, hitsound, 20, 1, -1)
visible_message("\red [A.name] is hit by the [src.name] in the [parse_zone(def_zone)]!")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
if(istype(firer, /mob))
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
if(M.ckey)
msg_admin_attack("[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
if(!iscarbon(firer))
M.LAssailant = null
else
playsound(loc, hitsound, 20, 1, -1)
visible_message("\red [A.name] is hit by the [src.name] in the [parse_zone(def_zone)]!")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
if(istype(firer, /mob))
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
if(M.ckey)
msg_admin_attack("[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
if(!iscarbon(firer))
M.LAssailant = null
else
M.LAssailant = firer
else
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
if(M.ckey)
msg_admin_attack("UNKNOWN shot [M] ([M.ckey]) with a [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
M.LAssailant = firer
else
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
if(M.ckey)
msg_admin_attack("UNKNOWN shot [M] ([M.ckey]) with a [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
if(A)
if (!forcedodge)
@@ -1,3 +1,248 @@
/obj/item/projectile/beam
name = "laser"
icon_state = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 20
damage_type = BURN
hitsound = 'sound/weapons/sear.ogg'
flag = "laser"
eyeblur = 2
/obj/item/projectile/practice
name = "laser"
icon_state = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 0
hitsound = null
damage_type = BURN
flag = "laser"
eyeblur = 2
/obj/item/projectile/beam/scatter
name = "laser pellet"
icon_state = "scatterlaser"
damage = 5
/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 = 15
irradiate = 30
/obj/item/projectile/beam/pulse
name = "pulse"
icon_state = "u_laser"
damage = 50
/obj/item/projectile/beam/pulse/on_hit(var/atom/target, var/blocked = 0)
if(istype(target,/turf/)||istype(target,/obj/structure/))
target.ex_act(2)
..()
/obj/item/projectile/beam/pulse/shot
damage = 40
/obj/item/projectile/beam/emitter
name = "emitter beam"
icon_state = "emitter"
damage = 30
/obj/item/projectile/lasertag
name = "laser tag beam"
icon_state = "omnilaser"
hitsound = null
damage = 0
flag = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
var/suit_types = list(/obj/item/clothing/suit/redtag, /obj/item/clothing/suit/bluetag)
/obj/item/projectile/lasertag/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))
if(M.wear_suit.type in suit_types)
M.Weaken(34)
return 1
/obj/item/projectile/lasertag/omni
name = "laser tag beam"
icon_state = "omnilaser"
/obj/item/projectile/lasertag/red
icon_state = "laser"
suit_types = list(/obj/item/clothing/suit/bluetag)
/obj/item/projectile/lasertag/blue
icon_state = "bluelaser"
suit_types = list(/obj/item/clothing/suit/redtag)
/obj/item/projectile/beam/lightning
invisibility = 101
name = "lightning"
damage = 0
icon = 'icons/obj/lightning.dmi'
icon_state = "lightning"
stun = 10
weaken = 10
stutter = 50
eyeblur = 50
var/tang = 0
layer = 3
var/turf/last = null
kill_count = 6
proc/adjustAngle(angle)
angle = round(angle) + 45
if(angle > 180)
angle -= 180
else
angle += 180
if(!angle)
angle = 1
/*if(angle < 0)
//angle = (round(abs(get_angle(A, user))) + 45) - 90
angle = round(angle) + 45 + 180
else
angle = round(angle) + 45*/
return angle
process()
var/first = 1 //So we don't make the overlay in the same tile as the firer
var/broke = 0
var/broken
var/atom/curr = current
var/Angle=round(Get_Angle(firer,curr))
var/icon/I=new('icons/obj/zap.dmi',"lightning")
I.Turn(Angle)
var/DX=(32*curr.x+curr.pixel_x)-(32*firer.x+firer.pixel_x)
var/DY=(32*curr.y+curr.pixel_y)-(32*firer.y+firer.pixel_y)
var/N=0
var/length=round(sqrt((DX)**2+(DY)**2))
var/count = 0
for(N,N<length,N+=32)
if(count >= kill_count)
break
count++
var/obj/effect/overlay/beam/X=new(loc)
X.BeamSource=src
if(N+32>length)
var/icon/II=new(icon,icon_state)
II.DrawBox(null,1,(length-N),32,32)
II.Turn(Angle)
X.icon=II
else X.icon=I
var/Pixel_x=round(sin(Angle)+32*sin(Angle)*(N+16)/32)
var/Pixel_y=round(cos(Angle)+32*cos(Angle)*(N+16)/32)
if(DX==0) Pixel_x=0
if(DY==0) Pixel_y=0
if(Pixel_x>32)
for(var/a=0, a<=Pixel_x,a+=32)
X.x++
Pixel_x-=32
if(Pixel_x<-32)
for(var/a=0, a>=Pixel_x,a-=32)
X.x--
Pixel_x+=32
if(Pixel_y>32)
for(var/a=0, a<=Pixel_y,a+=32)
X.y++
Pixel_y-=32
if(Pixel_y<-32)
for(var/a=0, a>=Pixel_y,a-=32)
X.y--
Pixel_y+=32
X.pixel_x=Pixel_x
X.pixel_y=Pixel_y
var/turf/TT = get_turf(X.loc)
if(TT == firer.loc)
continue
if(TT.density)
del(X)
break
for(var/atom/O in TT)
if(!O.CanPass(src))
del(X)
broke = 1
break
for(var/mob/living/O in TT.contents)
if(istype(O, /mob/living))
if(O.density)
del(X)
broke = 1
break
if(broke)
if(X)
del(X)
break
spawn
while(src) //Move until we hit something
if(first)
icon = midicon
if((!( current ) || loc == current)) //If we pass our target
broken = 1
icon = endicon
tang = adjustAngle(get_angle(original,current))
if(tang > 180)
tang -= 180
else
tang += 180
icon_state = "[tang]"
var/turf/simulated/floor/f = current
if(f && istype(f))
f.break_tile()
f.hotspot_expose(1000,CELL_VOLUME)
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
//world << "deleting"
//del(src) //Delete if it passes the world edge
broken = 1
return
if(kill_count < 1)
//world << "deleting"
//del(src)
broken = 1
kill_count--
//world << "[x] [y]"
if(!bumped && !isturf(original))
if(loc == get_turf(original))
if(!(original in permutated))
icon = endicon
if(!broken)
tang = adjustAngle(get_angle(original,current))
if(tang > 180)
tang -= 180
else
tang += 180
icon_state = "[tang]"
Bump(original)
first = 0
if(broken)
//world << "breaking"
break
else
last = get_turf(src.loc)
step_towards(src, current) //Move~
if(src.loc != current)
tang = adjustAngle(get_angle(src.loc,current))
icon_state = "[tang]"
del(src)
return
/*cleanup(reference) //Waits .3 seconds then removes the overlay.
//world << "setting invisibility"
sleep(50)
src.invisibility = 101
return*/
on_hit(atom/target, blocked = 0)
if(istype(target, /mob/living))
var/mob/living/M = target
M.playsound_local(src, "explosion", 50, 1)
..()
/*
/*
* Use: Caches beam state images and holds turfs that had these images overlaid.
* Structure:
@@ -399,3 +644,4 @@ var/list/beam_master = list()
damage = 0
agony = 40
damage_type = HALLOSS
*/
@@ -20,8 +20,14 @@
hitsound = 'sound/weapons/tase.ogg'
//Damage will be handled on the MOB side, to prevent window shattering.
on_hit(var/atom/target, var/blocked = 0)
if(!ismob(target) || blocked >= 2) //Fully blocked by mob or collided with dense object - burst into sparks!
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
/obj/item/projectile/energy/electroderevolver
/obj/item/projectile/energy/electrode/revolver
name = "electrode"
icon_state = "spark"
nodamage = 1
+1 -1
View File
@@ -97,7 +97,7 @@
bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj ,/obj/item/projectile/beam)||istype(Proj,/obj/item/projectile/bullet))
if(!istype(Proj ,/obj/item/projectile/beam/lastertag) && !istype(Proj ,/obj/item/projectile/beam/practice) )
if(!istype(Proj ,/obj/item/projectile/lasertag) && !istype(Proj ,/obj/item/projectile/practice) )
explode()
blob_act()
@@ -27,7 +27,7 @@ datum/chemical_reaction/coolant
/obj/structure/reagent_dispensers/coolanttank/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj ,/obj/item/projectile/beam)||istype(Proj,/obj/item/projectile/bullet))
if(!istype(Proj ,/obj/item/projectile/beam/lastertag) && !istype(Proj ,/obj/item/projectile/beam/practice) )
if(!istype(Proj ,/obj/item/projectile/lasertag) && !istype(Proj ,/obj/item/projectile/practice) )
explode()
/obj/structure/reagent_dispensers/coolanttank/blob_act()