mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-24 20:47:43 +01:00
@@ -22,7 +22,7 @@
|
||||
|
||||
weapons += new /datum/mecha_weapon/honker(src)
|
||||
weapons += new /datum/mecha_weapon/missile_rack/banana_mortar(src)
|
||||
weapons += new /datum/mecha_weapon/missile_rack/mousetrap_mortar(src)
|
||||
weapons += new /datum/mecha_weapon/missile_rack/banana_mortar/mousetrap_mortar(src)
|
||||
selected_weapon = weapons[1]
|
||||
return
|
||||
*/
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src)
|
||||
ME.attach(src)
|
||||
@@ -66,7 +66,7 @@
|
||||
del(ME)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive(src)
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/teleporter(src)
|
||||
ME.attach(src)
|
||||
|
||||
@@ -2,41 +2,68 @@
|
||||
name = "mecha weapon"
|
||||
range = RANGED
|
||||
origin_tech = "materials=3;combat=3"
|
||||
var/projectile
|
||||
var/fire_sound
|
||||
|
||||
var/projectile //Type of projectile fired.
|
||||
var/projectiles = 1 //Amount of projectiles loaded.
|
||||
var/projectiles_per_shot = 1 //Amount of projectiles fired per single shot.
|
||||
var/deviation = 0 //Inaccuracy of shots.
|
||||
var/fire_cooldown = 0 //Duration of sleep between firing projectiles in single shot.
|
||||
var/fire_sound //Sound played while firing.
|
||||
var/fire_volume = 50 //How loud it is played.
|
||||
var/auto_rearm = 0 //Does the weapon reload itself after each shot?
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/can_attach(var/obj/mecha/combat/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
if(!istype(M))
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/action_checks(atom/target)
|
||||
if(projectiles <= 0)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/action(atom/target)
|
||||
if(!action_checks(target))
|
||||
return
|
||||
var/turf/curloc = chassis.loc
|
||||
var/turf/targloc = get_turf(target)
|
||||
if(!curloc || !targloc)
|
||||
return
|
||||
chassis.use_power(energy_drain)
|
||||
chassis.visible_message("<span class='warning'>[chassis] fires [src]!</span>")
|
||||
occupant_message("<span class='warning'>You fire [src]!</span>")
|
||||
log_message("Fired from [src], targeting [target].")
|
||||
for(var/i = 1 to min(projectiles, projectiles_per_shot))
|
||||
var/turf/aimloc = targloc
|
||||
if(deviation)
|
||||
aimloc = locate(targloc.x+GaussRandRound(deviation,1),targloc.y+GaussRandRound(deviation,1),targloc.z)
|
||||
if(!aimloc || aimloc == curloc)
|
||||
break
|
||||
playsound(chassis, fire_sound, fire_volume, 1)
|
||||
projectiles--
|
||||
var/P = new projectile(curloc)
|
||||
Fire(P, target, aimloc)
|
||||
if(fire_cooldown)
|
||||
sleep(fire_cooldown)
|
||||
if(auto_rearm)
|
||||
projectiles = projectiles_per_shot
|
||||
set_ready_state(0)
|
||||
do_after_cooldown()
|
||||
return
|
||||
|
||||
/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()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy
|
||||
name = "General Energy Weapon"
|
||||
|
||||
action(target)
|
||||
if(!action_checks(target)) return
|
||||
var/turf/curloc = chassis.loc
|
||||
var/atom/targloc = get_turf(target)
|
||||
if (!targloc || !istype(targloc, /turf) || !curloc)
|
||||
return
|
||||
if (targloc == curloc)
|
||||
return
|
||||
set_ready_state(0)
|
||||
playsound(chassis, fire_sound, 50, 1)
|
||||
var/obj/item/projectile/A = new projectile(curloc)
|
||||
A.original = target
|
||||
A.current = curloc
|
||||
A.yo = targloc.y - curloc.y
|
||||
A.xo = targloc.x - curloc.x
|
||||
chassis.use_power(energy_drain)
|
||||
A.process()
|
||||
chassis.log_message("Fired from [src.name], targeting [target].")
|
||||
do_after_cooldown()
|
||||
return
|
||||
|
||||
auto_rearm = 1
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
|
||||
equip_cooldown = 8
|
||||
@@ -104,10 +131,9 @@
|
||||
construction_cost = list("metal"=20000,"bananium"=10000)
|
||||
|
||||
can_attach(obj/mecha/combat/honker/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
if(!istype(M))
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
action(target)
|
||||
if(!chassis)
|
||||
@@ -152,15 +178,8 @@
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic
|
||||
name = "General Ballisic Weapon"
|
||||
var/projectiles
|
||||
var/projectile_energy_cost
|
||||
|
||||
action_checks(atom/target)
|
||||
if(..())
|
||||
if(projectiles > 0)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
get_equip_info()
|
||||
return "[..()]\[[src.projectiles]\][(src.projectiles < initial(src.projectiles))?" - <a href='?src=\ref[src];rearm=1'>Rearm</a>":null]"
|
||||
|
||||
@@ -188,38 +207,11 @@
|
||||
equip_cooldown = 20
|
||||
projectile = /obj/item/projectile/bullet/midbullet
|
||||
fire_sound = 'sound/weapons/Gunshot.ogg'
|
||||
fire_volume = 80
|
||||
projectiles = 40
|
||||
projectiles_per_shot = 4
|
||||
deviation = 0.7
|
||||
projectile_energy_cost = 25
|
||||
var/projectiles_per_shot = 4
|
||||
var/deviation = 0.7
|
||||
|
||||
action(atom/target)
|
||||
if(!action_checks(target)) return
|
||||
var/turf/curloc = get_turf(chassis)
|
||||
var/turf/targloc = get_turf(target)
|
||||
if(!curloc || !targloc) return
|
||||
var/target_x = targloc.x
|
||||
var/target_y = targloc.y
|
||||
var/target_z = targloc.z
|
||||
targloc = null
|
||||
for(var/i=1 to min(projectiles, projectiles_per_shot))
|
||||
targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
|
||||
if(!targloc || targloc == curloc)
|
||||
break
|
||||
playsound(chassis, fire_sound, 80, 1)
|
||||
var/obj/item/projectile/A = new projectile(curloc)
|
||||
src.projectiles--
|
||||
A.original = target
|
||||
A.current = curloc
|
||||
A.yo = targloc.y - curloc.y
|
||||
A.xo = targloc.x - curloc.x
|
||||
set_ready_state(0)
|
||||
A.process()
|
||||
log_message("Fired from [src.name], targeting [target].")
|
||||
do_after_cooldown()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg
|
||||
name = "Ultra AC 2"
|
||||
@@ -228,41 +220,19 @@
|
||||
projectile = /obj/item/projectile/bullet/weakbullet
|
||||
fire_sound = 'sound/weapons/Gunshot.ogg'
|
||||
projectiles = 300
|
||||
projectiles_per_shot = 3
|
||||
deviation = 0.3
|
||||
projectile_energy_cost = 20
|
||||
var/projectiles_per_shot = 3
|
||||
var/deviation = 0.3
|
||||
|
||||
action(atom/target)
|
||||
if(!action_checks(target)) return
|
||||
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(!chassis) break
|
||||
var/turf/curloc = get_turf(chassis)
|
||||
targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
|
||||
if (!targloc || !curloc)
|
||||
continue
|
||||
if (targloc == curloc)
|
||||
continue
|
||||
|
||||
playsound(chassis, fire_sound, 50, 1)
|
||||
var/obj/item/projectile/A = new projectile(curloc)
|
||||
src.projectiles--
|
||||
A.original = target
|
||||
A.current = curloc
|
||||
A.yo = targloc.y - curloc.y
|
||||
A.xo = targloc.x - curloc.x
|
||||
A.process()
|
||||
sleep(2)
|
||||
set_ready_state(0)
|
||||
log_message("Fired from [src.name], targeting [target].")
|
||||
do_after_cooldown()
|
||||
return
|
||||
fire_cooldown = 2
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
|
||||
var/missile_speed = 2
|
||||
var/missile_range = 30
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/Fire(atom/movable/AM, atom/target, turf/aimloc)
|
||||
AM.throw_at(target,missile_range, missile_speed)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
|
||||
name = "SRM-8 Missile Rack"
|
||||
icon_state = "mecha_missilerack"
|
||||
projectile = /obj/item/missile
|
||||
@@ -270,21 +240,11 @@
|
||||
projectiles = 8
|
||||
projectile_energy_cost = 1000
|
||||
equip_cooldown = 60
|
||||
var/missile_speed = 2
|
||||
var/missile_range = 30
|
||||
|
||||
action(target)
|
||||
if(!action_checks(target)) return
|
||||
set_ready_state(0)
|
||||
var/obj/item/missile/M = new projectile(chassis.loc)
|
||||
M.primed = 1
|
||||
playsound(chassis, fire_sound, 50, 1)
|
||||
M.throw_at(target, missile_range, missile_speed)
|
||||
projectiles--
|
||||
log_message("Fired from [src.name], targeting [target].")
|
||||
do_after_cooldown()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive/Fire(atom/movable/AM, atom/target, turf/aimloc)
|
||||
var/obj/item/missile/M = AM
|
||||
M.primed = 1
|
||||
..()
|
||||
|
||||
/obj/item/missile
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
@@ -311,18 +271,11 @@
|
||||
equip_cooldown = 60
|
||||
var/det_time = 20
|
||||
|
||||
action(target)
|
||||
if(!action_checks(target)) return
|
||||
set_ready_state(0)
|
||||
var/obj/item/weapon/grenade/flashbang/F = new projectile(chassis.loc)
|
||||
playsound(chassis, fire_sound, 50, 1)
|
||||
F.throw_at(target, missile_range, missile_speed)
|
||||
projectiles--
|
||||
log_message("Fired from [src.name], targeting [target].")
|
||||
spawn(det_time)
|
||||
F.prime()
|
||||
do_after_cooldown()
|
||||
return
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/Fire(atom/movable/AM, atom/target, turf/aimloc)
|
||||
..()
|
||||
var/obj/item/weapon/grenade/flashbang/F = AM
|
||||
spawn(det_time)
|
||||
F.prime()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang//Because I am a heartless bastard -Sieve
|
||||
name = "SOP-6 Grenade Launcher"
|
||||
@@ -348,49 +301,17 @@
|
||||
construction_cost = list("metal"=20000,"bananium"=5000)
|
||||
|
||||
can_attach(obj/mecha/combat/honker/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
if(!istype(M))
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
action(target)
|
||||
if(!action_checks(target)) return
|
||||
set_ready_state(0)
|
||||
var/obj/item/weapon/bananapeel/B = new projectile(chassis.loc)
|
||||
playsound(chassis, fire_sound, 60, 1)
|
||||
B.throw_at(target, missile_range, missile_speed)
|
||||
projectiles--
|
||||
log_message("Bananed from [src.name], targeting [target]. HONK!")
|
||||
do_after_cooldown()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar
|
||||
name = "Mousetrap Mortar"
|
||||
icon_state = "mecha_mousetrapmrtr"
|
||||
projectile = /obj/item/device/assembly/mousetrap
|
||||
fire_sound = 'sound/items/bikehorn.ogg'
|
||||
projectiles = 15
|
||||
missile_speed = 1.5
|
||||
projectile_energy_cost = 100
|
||||
equip_cooldown = 10
|
||||
construction_time = 300
|
||||
construction_cost = list("metal"=20000,"bananium"=5000)
|
||||
|
||||
can_attach(obj/mecha/combat/honker/M as obj)
|
||||
if(..())
|
||||
if(istype(M))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
action(target)
|
||||
if(!action_checks(target)) return
|
||||
set_ready_state(0)
|
||||
var/obj/item/device/assembly/mousetrap/M = new projectile(chassis.loc)
|
||||
M.secured = 1
|
||||
playsound(chassis, fire_sound, 60, 1)
|
||||
M.throw_at(target, missile_range, missile_speed)
|
||||
projectiles--
|
||||
log_message("Launched a mouse-trap from [src.name], targeting [target]. HONK!")
|
||||
do_after_cooldown()
|
||||
return
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar/Fire(atom/movable/AM, atom/target, turf/aimloc)
|
||||
var/obj/item/device/assembly/mousetrap/M = AM
|
||||
M.secured = 1
|
||||
..()
|
||||
@@ -112,7 +112,7 @@
|
||||
///obj/item/mecha_parts/mecha_equipment/jetpack, //TODO MECHA JETPACK SPRITE MISSING
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/taser,
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg,
|
||||
///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar, HONK-related mech part
|
||||
///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar, HONK-related mech part
|
||||
///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar, Also HONK-related
|
||||
///obj/item/mecha_parts/mecha_equipment/weapon/honker Thirdly HONK-related
|
||||
),
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
name = "mecha part"
|
||||
icon = 'icons/mecha/mech_construct.dmi'
|
||||
icon_state = "blank"
|
||||
w_class = 20
|
||||
w_class = 5
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
origin_tech = "programming=2;materials=2"
|
||||
var/construction_time = 100
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/obj/mecha/medical/New()
|
||||
..()
|
||||
new /obj/item/mecha_parts/mecha_tracking(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T.z != 2)
|
||||
new /obj/item/mecha_parts/mecha_tracking(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
/obj/mecha/working/New()
|
||||
..()
|
||||
new /obj/item/mecha_parts/mecha_tracking(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T.z != 2)
|
||||
new /obj/item/mecha_parts/mecha_tracking(src)
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
@@ -196,6 +196,8 @@
|
||||
if(isrobot(user))
|
||||
return
|
||||
usr.drop_item()
|
||||
if(W)
|
||||
W.loc = src.loc
|
||||
else if(istype(W, /obj/item/weapon/packageWrap))
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/weldingtool))
|
||||
|
||||
@@ -479,6 +479,15 @@
|
||||
return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread"
|
||||
// output for machines^ ^^^^^^^output for people^^^^^^^^^
|
||||
|
||||
/mob/living/carbon/verb/mob_sleep()
|
||||
set name = "Sleep"
|
||||
set category = "IC"
|
||||
|
||||
if(usr.sleeping)
|
||||
usr << "\red You are already sleeping"
|
||||
return
|
||||
if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes")
|
||||
usr.sleeping = 20 //Short nap
|
||||
|
||||
//Brain slug proc for voluntary removal of control.
|
||||
/mob/living/carbon/proc/release_control()
|
||||
@@ -552,4 +561,4 @@
|
||||
|
||||
else
|
||||
src << "You do not have enough chemicals stored to reproduce."
|
||||
return
|
||||
return
|
||||
@@ -457,7 +457,7 @@
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, src )
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
|
||||
@@ -248,16 +248,16 @@
|
||||
|
||||
/mob/living/proc/restore_all_organs()
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/living/proc/revive()
|
||||
rejuvenate()
|
||||
buckled = initial(src.buckled)
|
||||
if(iscarbon(src))
|
||||
var/mob/living/carbon/C = src
|
||||
C.handcuffed = initial(C.handcuffed)
|
||||
|
||||
|
||||
/mob/living/proc/rejuvenate()
|
||||
|
||||
// shut down various types of badness
|
||||
@@ -268,14 +268,14 @@
|
||||
SetParalysis(0)
|
||||
SetStunned(0)
|
||||
SetWeakened(0)
|
||||
|
||||
|
||||
// shut down ongoing problems
|
||||
radiation = 0
|
||||
nutrition = 400
|
||||
bodytemperature = T20C
|
||||
sdisabilities = 0
|
||||
disabilities = 0
|
||||
|
||||
|
||||
// fix blindness and deafness
|
||||
blinded = 0
|
||||
eye_blind = 0
|
||||
@@ -284,27 +284,27 @@
|
||||
ear_deaf = 0
|
||||
ear_damage = 0
|
||||
heal_overall_damage(getBruteLoss(), getFireLoss())
|
||||
|
||||
|
||||
// restore all of a human's blood
|
||||
if(ishuman(src))
|
||||
var/mob/living/carbon/human/human_mob = src
|
||||
human_mob.restore_blood()
|
||||
|
||||
|
||||
// fix all of our organs
|
||||
restore_all_organs()
|
||||
|
||||
|
||||
// remove the character from the list of the dead
|
||||
if(stat == 2)
|
||||
dead_mob_list -= src
|
||||
living_mob_list += src
|
||||
tod = null
|
||||
|
||||
|
||||
// restore us to conciousness
|
||||
stat = CONSCIOUS
|
||||
|
||||
|
||||
// make the icons look correct
|
||||
regenerate_icons()
|
||||
|
||||
|
||||
return
|
||||
|
||||
/mob/living/proc/UpdateDamageIcon()
|
||||
@@ -661,3 +661,10 @@
|
||||
CM.legcuffed.loc = usr.loc
|
||||
CM.legcuffed = null
|
||||
CM.update_inv_legcuffed()
|
||||
|
||||
/mob/living/verb/lay_down()
|
||||
set name = "Rest"
|
||||
set category = "IC"
|
||||
|
||||
resting = !resting
|
||||
src << "\blue You are now [resting ? "resting" : "getting up"]"
|
||||
Reference in New Issue
Block a user