Reloadable lasers- needs sprites

Reloadable lasers plus upgrade thing stuff.  Tested, works.  Not added
to game yet.  Not twohanded yet-- maybe we should leave it onehanded?

Numbers for the laser are still up in the air.  It's pretty neat.  You
can load it with different types of lasers and stuff.
This commit is contained in:
Duck-
2014-12-23 00:53:22 -05:00
parent 0b344ff76a
commit a7dcf886ae
11 changed files with 243 additions and 45 deletions
+1
View File
@@ -1275,6 +1275,7 @@
#include "code\modules\projectiles\guns\projectile\bow.dm"
#include "code\modules\projectiles\guns\projectile\pistol.dm"
#include "code\modules\projectiles\guns\projectile\pneumatic.dm"
#include "code\modules\projectiles\guns\projectile\reloadlaser.dm"
#include "code\modules\projectiles\guns\projectile\revolver.dm"
#include "code\modules\projectiles\guns\projectile\rocket.dm"
#include "code\modules\projectiles\guns\projectile\shotgun.dm"
@@ -52,7 +52,7 @@
///////////LASER RIFLE//////////////
/obj/item/weapon/gun/energy/rifle/laser
name = "laser rifle"
desc = "a basic weapon designed kill with concentrated energy bolts"
desc = "a basic weapon designed to kill with concentrated energy bolts"
icon_state = "laser"
item_state = "laser"
fire_sound = 'sound/weapons/Laser.ogg'
@@ -1,6 +1,6 @@
/obj/item/weapon/gun/energy/laser
name = "laser rifle"
desc = "a basic weapon designed kill with concentrated energy bolts"
desc = "a basic weapon designed to kill with concentrated energy bolts"
icon_state = "laser"
item_state = "laser"
fire_sound = 'sound/weapons/Laser.ogg'
+3 -1
View File
@@ -38,12 +38,14 @@
loaded -= AC //Remove casing from loaded list.
if(isnull(AC) || !istype(AC))
return 0
AC.loc = get_turf(src) //Eject casing onto ground.
if(ejectshell == 1)
AC.loc = get_turf(src) //Eject casing onto ground. If 0, casings stay in the gun. Totally a good idea trust me okay.
if(AC.BB)
AC.desc += " This one is spent." //descriptions are magic - only when there's a projectile in the casing
in_chamber = AC.BB //Load projectile into chamber.
AC.BB.loc = src //Set projectile loc to gun.
return 1
return 0
@@ -0,0 +1,179 @@
/obj/item/weapon/gun/projectile/laser //butts
desc = "a basic weapon designed to kill with concentrated energy bolts."
name = "laser rifle"
caliber = "laser"
w_class = 3.0
recoil = 0
ammo_type = "/obj/item/ammo_casing/laser"
max_shells = 100
load_method = 2 //0 = Single shells or quick loader, 1 = box, 2 = magazine
fire_delay = 6
ejectshell = 0
slot_flags = SLOT_BACK
var/modded = 0
var/obj/item/weapon/reloadlasermodkit/mod
//placeholders//
icon_state = "laser"
item_state = "laser"
fire_sound = 'sound/weapons/Laser.ogg'
//placeholders// Well, okay, not the sound.
New()
for(var/i = 1, i <= 30, i++)
loaded += new ammo_type(src)
update_icon()
empty_mag = new /obj/item/ammo_magazine/laser/empty(src)
update_icon()
return
/obj/item/ammo_magazine/laser/empty
max_ammo = 0
/obj/item/ammo_magazine/laser
name = "charge cell (laser)"
desc = "A standard 30-shot cell."
icon_state = "12mm"
origin_tech = "combat=2"
ammo_type = "/obj/item/ammo_casing/laser"
max_ammo = 30
// multiple_sprites = 1
/obj/item/ammo_magazine/laser/pulse
name = "charge cell (pulse)"
desc = "A heavy-duty 15-shot pulse cell."
ammo_type = "/obj/item/ammo_casing/laser/pulse"
max_ammo = 15
/obj/item/ammo_magazine/laser/heavy
name = "charge cell (heavy)"
desc = "A 15-shot cell designed to overload your projectiles with an extremely heavy charge."
ammo_type = "/obj/item/ammo_casing/laser/heavy"
max_ammo = 15
/obj/item/ammo_magazine/laser/practice
name = "charge cell (practice)"
desc = "A hundred-shot cell keyed in to a harmless wavelength for practice shooting."
ammo_type = "/obj/item/ammo_casing/laser/practice"
max_ammo = 100
/obj/item/ammo_magazine/laser/light
name = "charge cell (light)"
desc = "A 60-shot cell designed with capacity in mind. The lasers are weaker, though."
ammo_type = "/obj/item/ammo_casing/laser/light"
max_ammo = 60
/obj/item/ammo_magazine/laser/stun
name = "charge cell (stun)"
desc = "A 20-shot cell that fires lethal incapacitating bolts. Not standard issue."
ammo_type = "/obj/item/ammo_casing/laser/stun"
max_ammo = 20
////////////////////////////
//Shells for the magazines//
////////////////////////////
//don't spawn these you butts//
/obj/item/ammo_casing/laser
desc = "A LASER SHELL. You shouldn't be seeing this."
caliber = "laser"
projectile_type = "/obj/item/projectile/beam"
/obj/item/ammo_casing/laser/pulse
desc = "A PULSE SHELL. You shouldn't be seeing this."
caliber = "laser"
projectile_type = "/obj/item/projectile/beam/pulse"
/obj/item/ammo_casing/laser/heavy
desc = "A LASER CANNON SHELL. You shouldn't be seeing this."
caliber = "laser"
projectile_type = "/obj/item/projectile/beam/heavylaser"
/obj/item/ammo_casing/laser/practice
desc = "A PRACTICE BLANK FAKE LASER SHELL. You shouldn't be seeing this."
caliber = "laser"
projectile_type = "/obj/item/projectile/beam/practice"
/obj/item/ammo_casing/laser/light
desc = "A LIGHT LASER XRAY SHELL. You shouldn't be seeing this."
caliber = "laser"
projectile_type = "/obj/item/projectile/beam/xray/burst"
/obj/item/ammo_casing/laser/stun
desc = "A STUN LASER SHELL. You shouldn't be seeing this."
caliber = "laser"
projectile_type = "/obj/item/projectile/beam/stun"
////////////////////////////////
//////////////mods//////////////
////////////////////////////////
/obj/item/weapon/reloadlasermodkit
desc = "A cheap, disposable modkit designed to rapidly and permanently augment NT-standard laser rifles."
name = "rifle nanokit"
var/modtype = 0
var/uses = 1
var/emagged
icon = 'icons/obj/assemblies.dmi'
icon_state = "posibrain" //the placeholders are real
/* Not sure about this yet.
/obj/item/device/megaphone/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/card/emag) && !emagged)
user << "\red You sneakily unlock the highly illegal military-grade burstfire augment."
emagged = 1
return
return
*/
/obj/item/weapon/reloadlasermodkit/attack_self(var/mob/user as mob)
if (!emagged)
if (modtype == 0)
user << "<span class='notice'>Size modification selected.</span>"
modtype = 1
else if (modtype == 1)
user << "<span class='notice'>Rapid-fire modification selected.</span>"
modtype = 2
else if (modtype == 2)
user << "<span class='notice'>Silencer modification selected.</span>"
modtype = 0
else if (emagged) //We'll see. Burst is ridiculous, especially on a full-power laser.
user << "<span class='notice'>Burstfire modification selected.</span>"
modtype = 3
/obj/item/weapon/gun/projectile/laser/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/reloadlasermodkit))
if(user.l_hand != src && user.r_hand != src) //if we're not in his hands
user << "<span class='notice'>You'll need [src] in your hands to do that.</span>"
return
if(src.modded == 1)
user << "<span class='notice'>The frame can only handle one mod.</span>"
return
user.drop_item()
user << "<span class='notice'>You activate the modkit and watch the nanites swarm over [src].</span>"
I.loc = src.mod
src.mod = I
src.modded = 1
if (mod.modtype == 0)
user << "<span class='notice'>[src]'s firerate has been increased.</span>"
src.fire_delay = 4
else if (mod.modtype == 1)
user << "<span class='notice'>[src]'s shape changes rapidly, becoming smaller and more economical.</span>"
src.w_class = 3
else if (mod.modtype == 2)
user << "<span class='notice'>[src] sprouts wave-cancelling emitters. Its shots are now silenced.</span>"
src.silenced = 1
else if (mod.modtype == 3)
user << "<span class='notice'>[src] rapidly reshapes its firing mechanism. It now fires in bursts.</span>"
src.fire_delay = 0
src.projectiles_per_shot = 3
src.fire_cooldown = 1
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
return
..()
+1 -1
View File
@@ -87,7 +87,7 @@
return 0// nope.avi
var/distance = get_dist(starting,loc)
var/miss_modifier = -30
var/miss_modifier = -60
if (istype(shot_from,/obj/item/weapon/gun)) //If you aim at someone beforehead, it'll hit more often.
var/obj/item/weapon/gun/daddy = shot_from //Kinda balanced by fact you need like 2 seconds to aim
+4 -3
View File
@@ -99,12 +99,13 @@ var/list/beam_master = list()
name = "xray beam"
icon_state = "xray"
damage = 30
// forcedodge = -1
/obj/item/projectile/beam/xray/burst
name = "xray beam"
icon_state = "xray"
// damage = 15 this makes rapidlasers kill almost exactly as fast as the rifle, but since they do a tripleburst, armor is much more effective. plus. rng miss.
damage = 20 //hence 20 damage. slight advantage over regular lasers. half-capacity for damage. use for coolness. use laser cannons for powergame.
damage = 25 //hence 25 damage. slight advantage over regular lasers. half-capacity for damage. use for coolness. use laser cannons for powergame.
/obj/item/projectile/beam/pulse
name = "pulse"
@@ -122,10 +123,10 @@ var/list/beam_master = list()
icon_state = "emitter"
damage = 30
/obj/item/projectile/beam/stunrevolver
/obj/item/projectile/beam/stun
name = "stun beam"
icon_state = "stun"
damage = 10
damage = 20
agony = 45
/obj/item/projectile/beam/lastertag/blue
@@ -88,3 +88,30 @@
*/
agony = 70
damage_type = HALLOSS
/obj/item/projectile/energy/mining //not in the game. i'll play with it later probably.
name = "electrode"
icon_state = "spark"
damage = 5
kill_count = 3
var/life = 5
Bump(atom/A)
A.bullet_act(src, def_zone)
src.life -= 1
if(life <= 0)
del(src)
return
/turf/simulated/mineral/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj ,/obj/item/projectile/energy/mining))
src.GetDrilled()
..()
return 0
/obj/structure/boulder/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj ,/obj/item/projectile/energy/mining))
del(src)
..()
return 0
+10 -10
View File
@@ -53,7 +53,7 @@
update_stats()
if(load && is_train_head())
load << "The drive motor briefly whines, then drones to a stop."
if(is_train_head() && !on)
return 0
@@ -118,7 +118,7 @@
verbs -= /obj/vehicle/train/cargo/engine/verb/stop_engine
verbs -= /obj/vehicle/train/cargo/engine/verb/start_engine
if(on)
verbs += /obj/vehicle/train/cargo/engine/verb/stop_engine
else
@@ -129,7 +129,7 @@
verbs -= /obj/vehicle/train/cargo/engine/verb/stop_engine
verbs -= /obj/vehicle/train/cargo/engine/verb/start_engine
if(!on)
verbs += /obj/vehicle/train/cargo/engine/verb/start_engine
else
@@ -180,7 +180,7 @@
if(!istype(usr, /mob/living/carbon/human))
return
if(get_dist(usr,src) <= 1)
usr << "The power light is [on ? "on" : "off"].\nThere are[key ? "" : " no"] keys in the ignition."
usr << "The charge meter reads [cell? round(cell.percent(), 0.01) : 0]%"
@@ -192,7 +192,7 @@
if(!istype(usr, /mob/living/carbon/human))
return
if(on)
usr << "The engine is already running."
return
@@ -210,10 +210,10 @@
set name = "Stop engine"
set category = "Object"
set src in view(1)
if(!istype(usr, /mob/living/carbon/human))
return
if(!on)
usr << "The engine is already stopped."
return
@@ -229,10 +229,10 @@
if(!istype(usr, /mob/living/carbon/human))
return
if(!key || (load && load != usr))
return
if(on)
turn_off()
@@ -291,7 +291,7 @@
/obj/vehicle/train/cargo/trolley/update_car(var/train_length, var/active_engines)
src.train_length = train_length
src.active_engines = active_engines
if(!lead && !tow)
anchored = 0
if(verbs.Find(/atom/movable/verb/pull))
+10 -10
View File
@@ -116,7 +116,7 @@
set desc = "Unhitches this train from the one in front of it."
set category = "Object"
set src in view(1)
if(!istype(usr, /mob/living/carbon/human))
return
@@ -139,11 +139,11 @@
if (lead)
user << "\red [src] is already hitched to something."
return
if (T.tow)
user << "\red [T] is already towing something."
return
//check for cycles.
var/obj/vehicle/train/next_car = T
while (next_car)
@@ -151,15 +151,15 @@
user << "\red That seems very silly."
return
next_car = next_car.lead
//latch with src as the follower
lead = T
T.tow = src
dir = lead.dir
if(user)
user << "\blue You hitch [src] to [T]."
update_stats()
@@ -168,10 +168,10 @@
if (!lead)
user << "\red [src] is not hitched to anything."
return
lead.tow = null
lead.update_stats()
user << "\blue You unhitch [src] from [lead]."
lead = null
@@ -190,7 +190,7 @@
//returns 1 if this is the lead car of the train
/obj/vehicle/train/proc/is_train_head()
if (lead)
if (lead)
return 0
return 1
@@ -209,7 +209,7 @@
if (T.tow == src)
lead.tow = null
lead.update_stats()
lead = null
update_stats()
return
+6 -18
View File
@@ -1,18 +1,6 @@
<small>23:57 [0x200793a] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>23:57 [0x200793a] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>23:57 [0x200793a] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>23:57 [0x200793a] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>23:58 [0x200793a] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>23:58 [0x200793a] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>00:03 [0x200793a] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>00:03 [0x200793a] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>00:08 [0x200793a] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>00:08 [0x200793a] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>00:12 [0x200793a] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>00:12 [0x200793a] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>00:17 [0x200793a] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>00:17 [0x200793a] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>00:22 [0x200793a] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>00:22 [0x200793a] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>00:27 [0x200793a] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>00:27 [0x200793a] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>00:42 [0x20078ca] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>00:42 [0x20078ca] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>00:43 [0x20078ca] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>00:43 [0x20078ca] (92,152,1)</small> || the gravitational generator is now charging.<br>
<small>00:43 [0x20078ca] (92,152,1)</small> || the gravitational generator has regained power.<br>
<small>00:43 [0x20078ca] (92,152,1)</small> || the gravitational generator is now charging.<br>