Mech's update (#6089)

This is a big PR, implements most of https://forums.aurorastation.org/topic/11276-the-small-ish-robotics-rework/

Changes:

rscadd: "Added Kinetic accelerator to mechs. RND can now research and make these Kinetc accelerators. There is a regular and a burst(3 shots) version. It will be better than average-decent man-held KA."

rscdel: "Added flamethrower for mechs. RND can now research and make this flamethrower. Works like man-held flamethrower."

soundadd: "Added flamethrower sound."

balance: "Hermes mech armour values has beeen rework. No longer it has bullet protection of millitary grade mech, and brute protection of a baby. Bomb protection increased, and fire protection decreased."

bugfix: "Fixed fire spam of burst mech weapons. Before if you click fast enough you were able to bypass cooldown x number of times in a row for burst mech weapons."

tweak: "Hydraulic clamp now loads all of the ores from a tile in one click into the box of mech. Just like mining satchel."

tweak: "The LBX AC 10 "Scattershot" now uses shotgun sound effect."

Replaces use of ':' inside of Mech's and hostile mob code
This commit is contained in:
Mykhailo Bykhovtsev
2019-03-18 00:05:52 -07:00
committed by Erki
parent f107160c96
commit d839bf0d48
14 changed files with 297 additions and 19 deletions

View File

@@ -20,6 +20,50 @@
//loading
if(istype(target,/obj))
var/obj/O = target
var/T = chassis.loc
if(istype(target, /obj/item/weapon/ore))
var/obj/mecha/working/chass = chassis // Since hydraulic clamp can only be installed on working mechs, no need to check for type.
var/obj/structure/ore_box/ore_box
if(chass)
ore_box = locate(/obj/structure/ore_box) in chass.cargo
if(ore_box)
var/list/stuff = range(chassis,1)
var/obj/item/weapon/ore/t = (locate(/obj/item/weapon/ore) in stuff)
if(t && do_after_cooldown())
if(T == chassis.loc && src == chassis.selected)
for(var/obj/item/weapon/ore/ore in stuff)
if(get_dir(chassis,ore)&chassis.dir)
ore.Move(ore_box)
chassis.visible_message("<span class='notice'>\The [chassis] picks up ore from the ground all around.</span>")
playsound(src.loc, 'sound/mecha/hydraulic.ogg', 50, 1, -1)
set_ready_state(0)
chassis.use_power(energy_drain)
do_after_cooldown()
return
else
occupant_message("<span class='warning'>You must hold still while handling objects.</span>")
return
else
occupant_message("You lift [target] and start to load it into cargo compartment.")
chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.")
playsound(src.loc, 'sound/mecha/hydraulic.ogg', 50, 1, -1)
set_ready_state(0)
chassis.use_power(energy_drain)
O.anchored = 1
if(do_after_cooldown())
if(T == chassis.loc && src == chassis.selected)
cargo_holder.cargo += O
O.forceMove(chassis)
O.anchored = 0
occupant_message("<span class='notice'>[target] succesfully loaded.</span>")
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
do_after_cooldown()
return
else
occupant_message("<span class='warning'>You must hold still while handling objects.</span>")
O.anchored = initial(O.anchored)
return
if(O.buckled_mob)
return
if(locate(/mob/living) in O)
@@ -38,7 +82,6 @@
set_ready_state(0)
chassis.use_power(energy_drain)
O.anchored = 1
var/T = chassis.loc
if(do_after_cooldown(target))
if(T == chassis.loc && src == chassis.selected)
cargo_holder.cargo += O
@@ -106,7 +149,10 @@
M.GetDrilled()
log_message("Drilled through \the [target]")
if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
var/obj/mecha/working/chass = chassis // Since hydraulic clamp can only be installed on working mechs, no need to check for type.
var/obj/structure/ore_box/ore_box
if(chass)
ore_box = locate(/obj/structure/ore_box) in chass.cargo
if(ore_box)
for(var/obj/item/weapon/ore/ore in range(chassis,1))
if(get_dir(chassis,ore)&chassis.dir)
@@ -117,7 +163,10 @@
M.gets_dug()
log_message("Drilled through \the [target]")
if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
var/obj/mecha/working/chass = chassis // Since hydraulic clamp can only be installed on working mechs, no need to check for type.
var/obj/structure/ore_box/ore_box
if(chass)
ore_box = locate(/obj/structure/ore_box) in chass.cargo
if(ore_box)
for(var/obj/item/weapon/ore/ore in range(chassis,1))
if(get_dir(chassis,ore)&chassis.dir)
@@ -159,7 +208,10 @@
M.GetDrilled()
log_message("Drilled through \the [target]")
if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
var/obj/mecha/working/chass = chassis // Since hydraulic clamp can only be installed on working mechs, no need to check for type.
var/obj/structure/ore_box/ore_box
if(chass)
ore_box = locate(/obj/structure/ore_box) in chass.cargo
if(ore_box)
for(var/obj/item/weapon/ore/ore in range(chassis,1))
if(get_dir(chassis,ore)&chassis.dir)
@@ -169,7 +221,10 @@
M.gets_dug()
log_message("Drilled through \the [target]")
if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
var/obj/mecha/working/chass = chassis // Since hydraulic clamp can only be installed on working mechs, no need to check for type.
var/obj/structure/ore_box/ore_box
if(chass)
ore_box = locate(/obj/structure/ore_box) in chass.cargo
if(ore_box)
for(var/obj/item/weapon/ore/ore in range(target,1))
ore.Move(ore_box)
@@ -1250,4 +1305,4 @@
to_chat(usr, "<span class='warning'>\The [src] doesn't have a passenger compartment.</span>")
#undef LOCKED
#undef OCCUPIED
#undef OCCUPIED

View File

@@ -28,7 +28,7 @@
icon_state = "mecha_scatter"
equip_cooldown = 20
projectile = /obj/item/projectile/bullet/pellet
fire_sound = 'sound/weapons/Gunshot.ogg'
fire_sound = 'sound/weapons/shotgun.ogg'
fire_volume = 80
projectiles = 40
deviation = 0.7

View File

@@ -104,4 +104,30 @@
fire_cooldown = 3
fire_time = 15
projectile = /obj/item/projectile/energy/tesla
fire_sound = 'sound/magic/LightningShock.ogg'
fire_sound = 'sound/magic/LightningShock.ogg'
/obj/item/mecha_parts/mecha_equipment/weapon/energy/kin_accelerator
name = "mounted kinetic accelerator"
desc = "A very robust mounted kinetic accelerator used by professional mining contractors intended for the use in mining soft metals such as gold on asteroids."
icon_state = "mecha_KA"
energy_drain = 40
projectiles_per_shot = 1
equip_cooldown = 15
projectile = /obj/item/projectile/kinetic/mech
fire_sound = 'sound/weapons/Kenetic_accel.ogg'
required_type = list(/obj/mecha/combat, /obj/mecha/working/hoverpod/combatpod, /obj/mecha/working/ripley)
/obj/item/mecha_parts/mecha_equipment/weapon/energy/kin_accelerator/Fire_wrapper(var/turf/curloc, atom/target, mob/user, params)
var/obj/item/projectile/kinetic/mech/P = new projectile(curloc)
Fire(P, target, user, params)
return
/obj/item/mecha_parts/mecha_equipment/weapon/energy/kin_accelerator/burst
name = "mounted burst kinetic accelerator"
desc = "A very robust mounted burst kinetic accelerator used by professional mining contractors intended for the use in mining soft metals such as gold on asteroids. This version shoots 3 projectiles at a time."
icon_state = "mecha_heavyKA"
energy_drain = 70
projectiles_per_shot = 3
fire_cooldown = 3
equip_cooldown = 30
projectile = /obj/item/projectile/kinetic/mech/burst

View File

@@ -11,6 +11,7 @@
var/fire_volume = 50 //How loud it is played.
var/auto_rearm = 0 //Does the weapon reload itself after each shot?
var/fire_time = 5 //used to stop mechas from hitting themselves with their own bullets
var/reset_time = FALSE // indicates if we need to wait before fire. Cause sleep sucks
required_type = list(/obj/mecha/combat, /obj/mecha/working/hoverpod/combatpod)
/obj/item/mecha_parts/mecha_equipment/weapon/action_checks(atom/target)
@@ -21,6 +22,9 @@
/obj/item/mecha_parts/mecha_equipment/weapon/action(atom/target, mob/user, params)
if(!action_checks(target))
return
if(reset_time)
occupant_message("<span class='warning'>\The [src] is not ready yet!</span>")
return
var/turf/curloc = chassis.loc
var/turf/targloc = get_turf(target)
if(!curloc || !targloc)
@@ -29,29 +33,146 @@
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].")
var/c = 0
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, user, params)
if(fire_cooldown)
sleep(fire_cooldown)
var/datum/callback/shoot_cb = CALLBACK(src, .proc/Fire_wrapper, curloc, target, user, params)
addtimer(shoot_cb, c + fire_cooldown)
c += fire_cooldown
if(equip_cooldown)
reset_time = TRUE
addtimer(CALLBACK(src, .proc/reset_fire), equip_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, mob/user, params)
var/obj/item/projectile/P = A
/obj/item/mecha_parts/mecha_equipment/weapon/proc/Fire_wrapper(var/turf/curloc, atom/target, mob/user, params)
var/obj/item/projectile/P = new projectile(curloc)
Fire(P, target, user, params)
return
/obj/item/mecha_parts/mecha_equipment/weapon/proc/Fire(var/obj/item/projectile/P, atom/target, mob/user, params)
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
H.setMoveCooldown(fire_time)
P.launch_projectile(target, def_zone, user, params)
playsound(chassis, fire_sound, fire_volume, 1)
/obj/item/mecha_parts/mecha_equipment/weapon/proc/reset_fire()
set_ready_state(1)
reset_time = FALSE
//////////////////////////
////// FLAMETHROWER //////
//////////////////////////
/obj/item/mecha_parts/mecha_equipment/weapon/flamethrower
name = "mounted flamethrower"
desc = "Mounted flamethrower for engineering firefighting exosuits. Used to deal with infestations."
icon_state = "mecha_flamethrower"
equip_cooldown = 10
fire_sound = 'sound/weapons/flamethrower.ogg'
fire_volume = 100
required_type = list(/obj/mecha/working/ripley, /obj/mecha/combat)
var/turf/previousturf = null
var/obj/item/weapon/tank/phoron/ptank = null
/obj/item/mecha_parts/mecha_equipment/weapon/flamethrower/examine(mob/user)
..()
if(ptank)
to_chat(user, "<span class='notice'>\The [src] has [ptank] attached, that displays [round(ptank.air_contents.return_pressure() ? ptank.air_contents.return_pressure() : 0)] KPa.</span>")
else
to_chat(user, "<span class='notice'>\The [src] has no tank attached.</span>")
/obj/item/mecha_parts/mecha_equipment/weapon/flamethrower/attackby(obj/item/W as obj, mob/user as mob)
if(user.stat || user.restrained() || user.lying) return
if(istype(W, /obj/item/weapon/tank/phoron))
if(ptank)
to_chat(user, "<span class='notice'>There appears to already be a phoron tank loaded in [src]!</span>")
return
to_chat(user, "<span class='notice'>You attach [W] to the [src].</span>")
user.drop_from_inventory(W, src)
ptank = W
update_icon()
return
// Change valve on internal tank
/obj/item/mecha_parts/mecha_equipment/weapon/flamethrower/verb/remove_tank()
set src in oview(1)
set category = "Object"
set name = "Remove tank"
if(!usr.canmove || usr.stat || usr.restrained())
return
if(!ishuman(usr))
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
return
if(ptank)
usr.visible_message(
"<span class='warning'>[usr] is removing [src]'s [ptank].</span>",
"<span class='notice'>You are removing [src]'s [ptank].</span>"
)
if (!do_after(usr, 2 SECONDS, act_target = src))
return
usr.visible_message(
"<span class='warning'>[usr] has removed [src]'s [ptank].</span>" ,
"<span class='notice'>You removed [src]'s [ptank].</span>"
)
update_icon()
else
to_chat(usr, "<span class='notice'>[src] has no tank.</span>")
/obj/item/mecha_parts/mecha_equipment/weapon/flamethrower/action(atom/target)
if(!action_checks(target)) return
if(!ptank)
occupant_message("<span class='warning'>[src] has no tank attached!</span>")
return
var/turf/target_turf = get_turf(target)
if(target_turf)
var/turflist = getline(chassis, target_turf)
playsound(chassis, fire_sound, fire_volume, 1)
flame_turf(turflist)
chassis.use_power(energy_drain)
chassis.visible_message("<span class='warning'>[chassis] fires wall of fire from [src]!</span>")
occupant_message("<span class='warning'>You fire wall of fire from [src]!</span>")
log_message("Fired from [src], targeting [target].")
if(equip_cooldown)
reset_time = TRUE
addtimer(CALLBACK(src, .proc/reset_fire), equip_cooldown)
//Called from turf.dm turf/dblclick
/obj/item/mecha_parts/mecha_equipment/weapon/flamethrower/proc/flame_turf(turflist)
for(var/turf/T in turflist)
if(T.density || istype(T, /turf/space))
break
if(!previousturf && length(turflist)>1)
previousturf = get_turf(src)
continue //so we don't burn the tile we be standin on
if(previousturf && LinkBlocked(previousturf, T))
break
ignite_turf(T)
sleep(1)
previousturf = null
for(var/mob/M in viewers(1, loc))
if((M.client && M.machine == src))
attack_self(M)
return
/obj/item/mecha_parts/mecha_equipment/weapon/flamethrower/proc/ignite_turf(turf/target)
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(0.02)
new/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(target, air_transfer.gas["phoron"]*15,get_dir(loc,target))
air_transfer.gas["phoron"] = 0
target.assume_air(air_transfer)
target.hotspot_expose((ptank.air_contents.temperature*2) + 380,500)
return

View File

@@ -9,7 +9,7 @@
health = 150
wreckage = /obj/effect/decal/mecha_wreckage/hermes
cargo_capacity = 6
damage_absorption = list("brute"=1.6,"fire"=0.3,"bullet"=0.5,"laser"=0.8,"energy"=1.25,"bomb"=2)
damage_absorption = list("brute"=0.8,"fire"=1,"bullet"=0.9,"laser"=0.9,"energy"=1,"bomb"=1.25)
internals_req_access = list()

View File

@@ -4,6 +4,7 @@
icon = 'icons/obj/flamethrower.dmi'
icon_state = "flamethrowerbase"
item_state = "flamethrower_0"
var/fire_sound = 'sound/weapons/flamethrower.ogg'
flags = CONDUCT
force = 3.0
throwforce = 10.0
@@ -165,6 +166,7 @@
/obj/item/weapon/flamethrower/proc/flame_turf(turflist)
if(!lit || operating) return
operating = 1
playsound(src, fire_sound, 70, 1)
for(var/turf/T in turflist)
if(T.density || istype(T, /turf/space))
break

View File

@@ -8,6 +8,12 @@
range = 5
var/pressure_decrease = 0.25
/obj/item/projectile/kinetic/mech
damage = 15
/obj/item/projectile/kinetic/mech/burst
damage = 10
/obj/item/projectile/kinetic/on_impact(var/atom/A,var/aoe_scale = 1, var/damage_scale = 1)
var/turf/target_turf = get_turf(A)
if(!target_turf)

View File

@@ -253,11 +253,11 @@ mob/living/simple_animal/hostile/hitby(atom/movable/AM as mob|obj,var/speed = TH
if (casingtype)
new casingtype(loc)
/mob/living/simple_animal/hostile/proc/Shoot(var/target, var/start, var/user, var/bullet = 0)
/mob/living/simple_animal/hostile/proc/Shoot(var/target, var/start, var/mob/user, var/bullet = 0)
if(target == start)
return
var/obj/item/projectile/A = new projectiletype(user:loc)
var/obj/item/projectile/A = new projectiletype(user.loc)
playsound(user, projectilesound, 100, 1)
if(!A) return
var/def_zone = get_exposed_defense_zone(target)

View File

@@ -488,6 +488,27 @@
id = "drill"
build_path = /obj/item/mecha_parts/mecha_equipment/tool/drill
/datum/design/item/mecha/kinetic_accelerator
name = "Burst kinetic accelerator"
id = "kinetic_accelerator"
req_tech = list(TECH_MATERIAL = 4, TECH_ENGINEERING = 3, TECH_MAGNET = 3, TECH_PHORON = 3)
materials = list("glass" = 2250, DEFAULT_WALL_MATERIAL = 55000, "silver" = 5250)
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/energy/kin_accelerator
/datum/design/item/mecha/kinetic_accelerator/burst
name = "Kinetic accelerator"
id = "kinetic_accelerator_burst"
req_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 4, TECH_MAGNET = 4, TECH_PHORON = 4)
materials = list("glass" = 5250, DEFAULT_WALL_MATERIAL = 60000, "silver" = 7250)
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/energy/kin_accelerator/burst
/datum/design/item/mecha/flamethrower
name = "Flamethrower"
id = "flamethrower"
req_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 4, TECH_COMBAT = 2, TECH_PHORON = 2)
materials = list("glass" = 5250, DEFAULT_WALL_MATERIAL = 40000)
build_path = /obj/item/mecha_parts/mecha_equipment/weapon/flamethrower
/datum/design/item/mecha/extinguisher
name = "Extinguisher"
id = "extinguisher"

View File

@@ -0,0 +1,47 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: PoZe
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "Added Kinetic accelerator to mechs. RND can now research and make these Kinetc accelerators. There is a regular and a burst(3 shots) version. It will be better than average-decent man-held KA."
- rscdel: "Added flamethrower for mechs. RND can now research and make this flamethrower. Works like man-held flamethrower."
- soundadd: "Added flamethrower sound."
- tweak: "The LBX AC 10 \"Scattershot\" now uses shotgun sound effect."
- balance: "Hermes mech armour values has beeen rework. No longer it has bullet protection of millitary grade mech, and brute protection of a baby. Bomb protection increased, and fire protection decreased."
- bugfix: "Fixed fire spam of burst mech weapons. Before if you click fast enough you were able to bypass cooldown x number of times in a row for burst mech weapons."
- tweak: "Hydraulic clamp now loads all of the ores from a tile in one click into the box of mech. Just like mining satchel."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.