Lessons were learned.
This commit is contained in:
skull132
2016-07-10 21:49:57 +03:00
committed by GitHub
parent db828e72d9
commit 8dfb08dab1
8 changed files with 41 additions and 113 deletions
+7
View File
@@ -134,3 +134,10 @@ Proc for attack log creation, because really why not
return 0
var/mob/living/silicon/robot/R = thing.loc
return (thing in R.module.modules)
/proc/get_exposed_defense_zone(var/atom/movable/target)
var/obj/item/weapon/grab/G = locate() in target
if (G && G.state >= GRAB_NECK)
return pick("head", "l_hand", "r_hand", "l_foot", "r_foot", "l_arm", "r_arm", "l_leg", "r_leg")
else
return pick("chest", "groin")
+2 -13
View File
@@ -618,7 +618,6 @@ var/list/turret_icons
else
A = new projectile(loc)
playsound(loc, shot_sound, 75, 1)
A.original = target
// Lethal/emagged turrets use twice the power due to higher energy beams
// Emagged turrets again use twice as much power due to higher firing rates
@@ -626,19 +625,9 @@ var/list/turret_icons
//Turrets aim for the center of mass by default.
//If the target is grabbing someone then the turret smartly aims for extremities
var/obj/item/weapon/grab/G = locate() in target
if(G && G.state >= GRAB_NECK) //works because mobs are currently not allowed to upgrade to NECK if they are grabbing two people.
A.def_zone = pick("head", "l_hand", "r_hand", "l_foot", "r_foot", "l_arm", "r_arm", "l_leg", "r_leg")
else
A.def_zone = pick("chest", "groin")
var/def_zone = get_exposed_defense_zone(target)
//Shooting Code:
A.current = T
A.starting = T
A.yo = U.y - T.y
A.xo = U.x - T.x
spawn(1)
A.process()
A.launch(target, def_zone)
/datum/turret_checks
var/enabled
+10 -28
View File
@@ -261,26 +261,17 @@
A = new /obj/item/projectile/beam/lastertag/blue( loc )
if(6)
A = new /obj/item/projectile/beam/lastertag/red( loc )
A.original = target
use_power(500)
else
A = new /obj/item/projectile/energy/electrode( loc )
use_power(200)
//Turrets aim for the center of mass by default.
//If the target is grabbing someone then the turret smartly aims for extremities
var/obj/item/weapon/grab/G = locate() in target
if(G && G.state >= GRAB_NECK) //works because mobs are currently not allowed to upgrade to NECK if they are grabbing two people.
A.def_zone = pick("head", "l_hand", "r_hand", "l_foot", "r_foot", "l_arm", "r_arm", "l_leg", "r_leg")
else
A.def_zone = pick("chest", "groin")
A.current = T
A.starting = T
A.yo = U.y - T.y
A.xo = U.x - T.x
spawn( 0 )
A.process()
var/def_zone = get_exposed_defense_zone(target)
A.launch(target, def_zone)
return
@@ -507,25 +498,16 @@
cur_target = null
return
src.set_dir(get_dir(src,target))
var/turf/targloc = get_turf(target)
var/target_x = targloc.x
var/target_y = targloc.y
var/target_z = targloc.z
targloc = null
spawn for(var/i=1 to min(projectiles, projectiles_per_shot))
if(!src) break
var/turf/curloc = get_turf(src)
targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
if (!targloc || !curloc)
continue
if (targloc == curloc)
continue
playsound(src, 'sound/weapons/Gunshot.ogg', 50, 1)
var/obj/item/projectile/A = new /obj/item/projectile(curloc)
src.projectiles--
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
A.process()
var/def_zone = get_exposed_defense_zone(target)
A.launch(target, def_zone)
sleep(2)
return
+6 -9
View File
@@ -48,14 +48,11 @@
/obj/item/mecha_parts/mecha_equipment/weapon/proc/Fire(atom/A, atom/target, turf/aimloc)
var/obj/item/projectile/P = A
P.shot_from = src
P.original = target
P.starting = P.loc
P.current = P.loc
P.firer = chassis.occupant
P.yo = aimloc.y - P.loc.y
P.xo = aimloc.x - P.loc.x
P.process()
var/def_zone
if (chassis && istype(chassis.occupant, /mob/living/carbon/human))
var/mob/living/carbon/human/H = chassis.occupant
def_zone = H.zone_sel.selecting
P.launch(target, def_zone)
/obj/item/mecha_parts/mecha_equipment/weapon/energy
name = "general energy weapon"
@@ -280,4 +277,4 @@
return "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span>&nbsp;[chassis.selected==src?"<b>":"<a href='?src=\ref[chassis];select_equip=\ref[src]'>"][src.name][chassis.selected==src?"</b>":"</a>"]\[[src.projectiles]\]"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang/limited/rearm()
return//Extra bit of security
return//Extra bit of security
+2 -9
View File
@@ -56,8 +56,6 @@
return
last_shot = world.time
var/turf/T = get_turf(src)
var/turf/U = get_turf(A)
var/projectile = /obj/item/projectile/beam/stun
if(emagged)
@@ -65,14 +63,9 @@
playsound(loc, emagged ? 'sound/weapons/Laser.ogg' : 'sound/weapons/Taser.ogg', 50, 1)
var/obj/item/projectile/P = new projectile(loc)
var/def_zone = get_exposed_defense_zone(A)
P.launch(A, def_zone)
P.original = A
P.starting = T
P.current = T
P.yo = U.y - T.y
P.xo = U.x - T.x
spawn()
P.process()
return
// Assembly
@@ -171,29 +171,8 @@
visible_message("<span class='warning'>[src] spits neurotoxin at [target]!</span>", "<span class='alium'>You spit neurotoxin at [target].</span>")
//I'm not motivated enough to revise this. Prjectile code in general needs update.
// Maybe change this to use throw_at? ~ Z
var/turf/T = loc
var/turf/U = (istype(target, /atom/movable) ? target.loc : target)
if(!U || !T)
return
while(U && !istype(U,/turf))
U = U.loc
if(!istype(T, /turf))
return
if (U == T)
usr.bullet_act(new /obj/item/projectile/energy/neurotoxin(usr.loc), get_organ_target())
return
if(!istype(U, /turf))
return
var/obj/item/projectile/energy/neurotoxin/A = new /obj/item/projectile/energy/neurotoxin(usr.loc)
A.current = U
A.yo = U.y - T.y
A.xo = U.x - T.x
A.process()
return
A.launch(target, get_organ_target())
/mob/living/carbon/human/proc/resin() // -- TLE
set name = "Secrete Resin (75)"
@@ -217,4 +196,4 @@
new /obj/effect/alien/resin/membrane(loc)
if("resin nest")
new /obj/structure/bed/nest(loc)
return
return
@@ -155,22 +155,21 @@
var/target = target_mob
visible_message("\red <b>[src]</b> fires at [target]!", 1)
var/tturf = get_turf(target)
if(rapid)
spawn(1)
Shoot(tturf, src.loc, src)
Shoot(target, src.loc, src)
if(casingtype)
new casingtype(get_turf(src))
spawn(4)
Shoot(tturf, src.loc, src)
Shoot(target, src.loc, src)
if(casingtype)
new casingtype(get_turf(src))
spawn(6)
Shoot(tturf, src.loc, src)
Shoot(target, src.loc, src)
if(casingtype)
new casingtype(get_turf(src))
else
Shoot(tturf, src.loc, src)
Shoot(target, src.loc, src)
if(casingtype)
new casingtype
@@ -187,16 +186,9 @@
playsound(user, projectilesound, 100, 1)
if(!A) return
if (!istype(target, /turf))
qdel(A)
return
A.current = target
A.starting = get_turf(src)
A.original = get_turf(target)
A.yo = target:y - start:y
A.xo = target:x - start:x
spawn( 0 )
A.process()
var/def_zone = get_exposed_defense_zone(target)
A.launch(target, def_zone)
return
/mob/living/simple_animal/hostile/proc/DestroySurroundings()
+5 -16
View File
@@ -129,27 +129,16 @@
//need to calculate the power per shot as the emitter doesn't fire continuously.
var/burst_time = (min_burst_delay + max_burst_delay)/2 + 2*(burst_shots-1)
var/power_per_shot = active_power_usage * (burst_time/10) / burst_shots
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter( src.loc )
A.damage = round(power_per_shot/EMITTER_DAMAGE_POWER_TRANSFER)
playsound(src.loc, 'sound/weapons/emitter.ogg', 25, 1)
if(prob(35))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
A.set_dir(src.dir)
A.starting = get_turf(src)
switch(dir)
if(NORTH)
A.original = locate(x, y+1, z)
if(EAST)
A.original = locate(x+1, y, z)
if(WEST)
A.original = locate(x-1, y, z)
else // Any other
A.original = locate(x, y-1, z)
A.process()
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter( src.loc )
playsound(src.loc, 'sound/weapons/emitter.ogg', 25, 1)
A.damage = round(power_per_shot/EMITTER_DAMAGE_POWER_TRANSFER)
A.launch(get_step(src.loc, src.dir))
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user)
@@ -235,4 +224,4 @@
return
..()
return
return