* Fixing updater * Adds the gunthingy * makes the bullet * Update mecha_designs.dm * Update all_nodes.dm * Fixes stam harm
445 lines
16 KiB
Plaintext
445 lines
16 KiB
Plaintext
/obj/item/mecha_parts/mecha_equipment/weapon
|
|
name = "mecha weapon"
|
|
range = RANGED
|
|
var/projectile
|
|
var/fire_sound
|
|
var/projectiles_per_shot = 1
|
|
var/variance = 0
|
|
var/randomspread = 0 //use random spread for machineguns, instead of shotgun scatter
|
|
var/projectile_delay = 0
|
|
var/firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect //the visual effect appearing when the weapon is fired.
|
|
var/kickback = TRUE //Will using this weapon in no grav push mecha back.
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/can_attach(obj/mecha/combat/M)
|
|
if(..())
|
|
if(istype(M))
|
|
return 1
|
|
return 0
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/proc/get_shot_amount()
|
|
return projectiles_per_shot
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/action(atom/target, params)
|
|
if(!action_checks(target))
|
|
return 0
|
|
|
|
var/turf/curloc = get_turf(chassis)
|
|
var/turf/targloc = get_turf(target)
|
|
if (!targloc || !istype(targloc) || !curloc)
|
|
return 0
|
|
if (targloc == curloc)
|
|
return 0
|
|
|
|
set_ready_state(0)
|
|
for(var/i=1 to get_shot_amount())
|
|
var/obj/item/projectile/A = new projectile(curloc)
|
|
A.firer = chassis.occupant
|
|
A.original = target
|
|
if(!A.suppressed && firing_effect_type)
|
|
new firing_effect_type(get_turf(src), chassis.dir)
|
|
|
|
var/spread = 0
|
|
if(variance)
|
|
if(randomspread)
|
|
spread = round((rand() - 0.5) * variance)
|
|
else
|
|
spread = round((i / projectiles_per_shot - 0.5) * variance)
|
|
A.preparePixelProjectile(target, chassis.occupant, params, spread)
|
|
|
|
A.fire()
|
|
playsound(chassis, fire_sound, 50, 1)
|
|
|
|
sleep(max(0, projectile_delay))
|
|
|
|
if(kickback)
|
|
chassis.newtonian_move(turn(chassis.dir,180))
|
|
chassis.log_message("Fired from [src.name], targeting [target].")
|
|
return 1
|
|
|
|
|
|
//Base energy weapon type
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy
|
|
name = "general energy weapon"
|
|
firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/energy
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/get_shot_amount()
|
|
return min(round(chassis.cell.charge / energy_drain), projectiles_per_shot)
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/start_cooldown()
|
|
set_ready_state(0)
|
|
chassis.use_power(energy_drain*get_shot_amount())
|
|
addtimer(CALLBACK(src, .proc/set_ready_state, 1), equip_cooldown)
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
|
|
equip_cooldown = 8
|
|
name = "\improper CH-PS \"Immolator\" laser"
|
|
desc = "A weapon for combat exosuits. Shoots basic lasers."
|
|
icon_state = "mecha_laser"
|
|
energy_drain = 30
|
|
projectile = /obj/item/projectile/beam/laser
|
|
fire_sound = 'sound/weapons/laser.ogg'
|
|
harmful = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/heavy
|
|
equip_cooldown = 15
|
|
name = "\improper CH-LC \"Solaris\" laser cannon"
|
|
desc = "A weapon for combat exosuits. Shoots heavy lasers."
|
|
icon_state = "mecha_laser"
|
|
energy_drain = 60
|
|
projectile = /obj/item/projectile/beam/laser/heavylaser
|
|
fire_sound = 'sound/weapons/lasercannonfire.ogg'
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/ion
|
|
equip_cooldown = 20
|
|
name = "\improper MKIV ion heavy cannon"
|
|
desc = "A weapon for combat exosuits. Shoots technology-disabling ion beams. Don't catch yourself in the blast!"
|
|
icon_state = "mecha_ion"
|
|
energy_drain = 120
|
|
projectile = /obj/item/projectile/ion
|
|
fire_sound = 'sound/weapons/laser.ogg'
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/tesla
|
|
equip_cooldown = 35
|
|
name = "\improper MKI Tesla Cannon"
|
|
desc = "A weapon for combat exosuits. Fires bolts of electricity similar to the experimental tesla engine."
|
|
icon_state = "mecha_ion"
|
|
energy_drain = 500
|
|
projectile = /obj/item/projectile/energy/tesla/cannon
|
|
fire_sound = 'sound/magic/lightningbolt.ogg'
|
|
harmful = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse
|
|
equip_cooldown = 30
|
|
name = "eZ-13 MK2 heavy pulse rifle"
|
|
desc = "A weapon for combat exosuits. Shoots powerful destructive blasts capable of demolishing obstacles."
|
|
icon_state = "mecha_pulse"
|
|
energy_drain = 120
|
|
projectile = /obj/item/projectile/beam/pulse/heavy
|
|
fire_sound = 'sound/weapons/marauder.ogg'
|
|
harmful = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma
|
|
equip_cooldown = 10
|
|
name = "217-D Heavy Plasma Cutter"
|
|
desc = "A device that shoots resonant plasma bursts at extreme velocity. The blasts are capable of crushing rock and demolishing solid obstacles."
|
|
icon_state = "mecha_plasmacutter"
|
|
item_state = "plasmacutter"
|
|
lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi'
|
|
energy_drain = 30
|
|
projectile = /obj/item/projectile/plasma/adv/mech
|
|
fire_sound = 'sound/weapons/plasma_cutter.ogg'
|
|
harmful = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma/can_attach(obj/mecha/working/M)
|
|
if(..()) //combat mech
|
|
return 1
|
|
else if(M.equipment.len < M.max_equip && istype(M))
|
|
return 1
|
|
return 0
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/energy/taser
|
|
name = "\improper PBT \"Pacifier\" mounted taser"
|
|
desc = "A weapon for combat exosuits. Shoots non-lethal stunning electrodes."
|
|
icon_state = "mecha_taser"
|
|
energy_drain = 20
|
|
equip_cooldown = 8
|
|
projectile = /obj/item/projectile/energy/electrode
|
|
fire_sound = 'sound/weapons/taser.ogg'
|
|
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/honker
|
|
name = "\improper HoNkER BlAsT 5000"
|
|
desc = "Equipment for clown exosuits. Spreads fun and joy to everyone around. Honk!"
|
|
icon_state = "mecha_honker"
|
|
energy_drain = 200
|
|
equip_cooldown = 150
|
|
range = MELEE|RANGED
|
|
kickback = FALSE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/honker/can_attach(obj/mecha/combat/honker/M)
|
|
if(..())
|
|
if(istype(M))
|
|
return 1
|
|
return 0
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/honker/action(target, params)
|
|
if(!action_checks(target))
|
|
return
|
|
playsound(chassis, 'sound/items/airhorn.ogg', 100, 1)
|
|
chassis.occupant_message("<font color='red' size='5'>HONK</font>")
|
|
for(var/mob/living/carbon/M in ohearers(6, chassis))
|
|
if(ishuman(M))
|
|
var/mob/living/carbon/human/H = M
|
|
if(istype(H.ears, /obj/item/clothing/ears/earmuffs))
|
|
continue
|
|
to_chat(M, "<font color='red' size='7'>HONK</font>")
|
|
M.SetSleeping(0)
|
|
M.stuttering += 20
|
|
M.adjustEarDamage(0, 30)
|
|
M.Knockdown(60)
|
|
if(prob(30))
|
|
M.Stun(200)
|
|
M.Unconscious(80)
|
|
else
|
|
M.Jitter(500)
|
|
|
|
log_message("Honked from [src.name]. HONK!")
|
|
var/turf/T = get_turf(src)
|
|
message_admins("[ADMIN_LOOKUPFLW(chassis.occupant)] used a Mecha Honker in [ADMIN_VERBOSEJMP(T)]")
|
|
log_game("[key_name(chassis.occupant)] used a Mecha Honker in [AREACOORD(T)]")
|
|
return 1
|
|
|
|
|
|
//Base ballistic weapon type
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic
|
|
name = "general ballistic weapon"
|
|
fire_sound = 'sound/weapons/gunshot.ogg'
|
|
var/projectiles
|
|
var/projectile_energy_cost
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/get_shot_amount()
|
|
return min(projectiles, projectiles_per_shot)
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/action_checks(target)
|
|
if(!..())
|
|
return 0
|
|
if(projectiles <= 0)
|
|
return 0
|
|
return 1
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/get_equip_info()
|
|
return "[..()] \[[src.projectiles]\][(src.projectiles < initial(src.projectiles))?" - <a href='?src=[REF(src)];rearm=1'>Rearm</a>":null]"
|
|
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/rearm()
|
|
if(projectiles < initial(projectiles))
|
|
var/projectiles_to_add = initial(projectiles) - projectiles
|
|
while(chassis.get_charge() >= projectile_energy_cost && projectiles_to_add)
|
|
projectiles++
|
|
projectiles_to_add--
|
|
chassis.use_power(projectile_energy_cost)
|
|
send_byjax(chassis.occupant,"exosuit.browser","[REF(src)]",src.get_equip_info())
|
|
log_message("Rearmed [src.name].")
|
|
return 1
|
|
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/needs_rearm()
|
|
. = !(projectiles > 0)
|
|
|
|
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/Topic(href, href_list)
|
|
..()
|
|
if (href_list["rearm"])
|
|
src.rearm()
|
|
return
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/action(atom/target)
|
|
if(..())
|
|
projectiles -= get_shot_amount()
|
|
send_byjax(chassis.occupant,"exosuit.browser","[REF(src)]",src.get_equip_info())
|
|
return 1
|
|
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/carbine
|
|
name = "\improper FNX-99 \"Hades\" Carbine"
|
|
desc = "A weapon for combat exosuits. Shoots incendiary bullets."
|
|
icon_state = "mecha_carbine"
|
|
equip_cooldown = 10
|
|
projectile = /obj/item/projectile/bullet/incendiary/fnx99
|
|
projectiles = 24
|
|
projectile_energy_cost = 15
|
|
harmful = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/silenced
|
|
name = "\improper S.H.H. \"Quietus\" Carbine"
|
|
desc = "A weapon for combat exosuits. A mime invention, field tests have shown that targets cannot even scream before going down."
|
|
fire_sound = 'sound/weapons/gunshot_silenced.ogg'
|
|
icon_state = "mecha_mime"
|
|
equip_cooldown = 30
|
|
projectile = /obj/item/projectile/bullet/mime
|
|
projectiles = 6
|
|
projectile_energy_cost = 50
|
|
harmful = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot
|
|
name = "\improper LBX AC 10 \"Scattershot\""
|
|
desc = "A weapon for combat exosuits. Shoots a spread of pellets."
|
|
icon_state = "mecha_scatter"
|
|
equip_cooldown = 20
|
|
projectile = /obj/item/projectile/bullet/scattershot
|
|
projectiles = 40
|
|
projectile_energy_cost = 25
|
|
projectiles_per_shot = 4
|
|
variance = 25
|
|
harmful = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/seedscatter
|
|
name = "\improper Melon Seed \"Scattershot\""
|
|
desc = "A weapon for combat exosuits. Shoots a spread of pellets, shaped as seed."
|
|
icon_state = "mecha_scatter"
|
|
equip_cooldown = 30
|
|
projectile = /obj/item/projectile/bullet/seed
|
|
projectiles = 4
|
|
projectile_energy_cost = 55
|
|
projectiles_per_shot = 10
|
|
variance = 20
|
|
harmful = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg
|
|
name = "\improper Ultra AC 2"
|
|
desc = "A weapon for combat exosuits. Shoots a rapid, three shot burst."
|
|
icon_state = "mecha_uac2"
|
|
equip_cooldown = 10
|
|
projectile = /obj/item/projectile/bullet/lmg
|
|
projectiles = 300
|
|
projectile_energy_cost = 20
|
|
projectiles_per_shot = 3
|
|
variance = 6
|
|
randomspread = 1
|
|
projectile_delay = 2
|
|
harmful = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
|
|
name = "\improper SRM-8 missile rack"
|
|
desc = "A weapon for combat exosuits. Shoots light explosive missiles."
|
|
icon_state = "mecha_missilerack"
|
|
projectile = /obj/item/projectile/bullet/srmrocket
|
|
fire_sound = 'sound/weapons/grenadelaunch.ogg'
|
|
projectiles = 8
|
|
projectile_energy_cost = 1000
|
|
equip_cooldown = 60
|
|
harmful = TRUE
|
|
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher
|
|
var/missile_speed = 2
|
|
var/missile_range = 30
|
|
var/diags_first = FALSE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/action(target)
|
|
if(!action_checks(target))
|
|
return
|
|
var/obj/O = new projectile(chassis.loc)
|
|
playsound(chassis, fire_sound, 50, 1)
|
|
log_message("Launched a [O.name] from [name], targeting [target].")
|
|
projectiles--
|
|
proj_init(O)
|
|
O.throw_at(target, missile_range, missile_speed, chassis.occupant, FALSE, diagonals_first = diags_first)
|
|
return 1
|
|
|
|
//used for projectile initilisation (priming flashbang) and additional logging
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/proc/proj_init(var/obj/O)
|
|
return
|
|
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang
|
|
name = "\improper SGL-6 grenade launcher"
|
|
desc = "A weapon for combat exosuits. Launches primed flashbangs."
|
|
icon_state = "mecha_grenadelnchr"
|
|
projectile = /obj/item/grenade/flashbang
|
|
fire_sound = 'sound/weapons/grenadelaunch.ogg'
|
|
projectiles = 6
|
|
missile_speed = 1.5
|
|
projectile_energy_cost = 800
|
|
equip_cooldown = 60
|
|
var/det_time = 20
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/proj_init(var/obj/item/grenade/flashbang/F)
|
|
var/turf/T = get_turf(src)
|
|
message_admins("[ADMIN_LOOKUPFLW(chassis.occupant)] fired a [src] in [ADMIN_VERBOSEJMP(T)]")
|
|
log_game("[key_name(chassis.occupant)] fired a [src] in [AREACOORD(T)]")
|
|
addtimer(CALLBACK(F, /obj/item/grenade/flashbang.proc/prime), det_time)
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/clusterbang //Because I am a heartless bastard -Sieve //Heartless? for making the poor man's honkblast? - Kaze
|
|
name = "\improper SOB-3 grenade launcher"
|
|
desc = "A weapon for combat exosuits. Launches primed clusterbangs. You monster."
|
|
projectiles = 3
|
|
projectile = /obj/item/grenade/clusterbuster
|
|
projectile_energy_cost = 1600 //getting off cheap seeing as this is 3 times the flashbangs held in the grenade launcher.
|
|
equip_cooldown = 90
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar
|
|
name = "banana mortar"
|
|
desc = "Equipment for clown exosuits. Launches banana peels."
|
|
icon_state = "mecha_bananamrtr"
|
|
projectile = /obj/item/grown/bananapeel
|
|
fire_sound = 'sound/items/bikehorn.ogg'
|
|
projectiles = 15
|
|
missile_speed = 1.5
|
|
projectile_energy_cost = 100
|
|
equip_cooldown = 20
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar/can_attach(obj/mecha/combat/honker/M)
|
|
if(..())
|
|
if(istype(M))
|
|
return 1
|
|
return 0
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar
|
|
name = "mousetrap mortar"
|
|
desc = "Equipment for clown exosuits. Launches armed mousetraps."
|
|
icon_state = "mecha_mousetrapmrtr"
|
|
projectile = /obj/item/assembly/mousetrap/armed
|
|
fire_sound = 'sound/items/bikehorn.ogg'
|
|
projectiles = 15
|
|
missile_speed = 1.5
|
|
projectile_energy_cost = 100
|
|
equip_cooldown = 10
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar/can_attach(obj/mecha/combat/honker/M)
|
|
if(..())
|
|
if(istype(M))
|
|
return 1
|
|
return 0
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar/proj_init(var/obj/item/assembly/mousetrap/armed/M)
|
|
M.secured = 1
|
|
|
|
|
|
//Classic extending punching glove, but weaponised!
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/punching_glove
|
|
name = "\improper Oingo Boingo Punch-face"
|
|
desc = "Equipment for clown exosuits. Delivers fun right to your face!"
|
|
icon_state = "mecha_punching_glove"
|
|
energy_drain = 250
|
|
equip_cooldown = 20
|
|
range = MELEE|RANGED
|
|
missile_range = 5
|
|
projectile = /obj/item/punching_glove
|
|
fire_sound = 'sound/items/bikehorn.ogg'
|
|
projectiles = 10
|
|
projectile_energy_cost = 500
|
|
diags_first = TRUE
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/punching_glove/can_attach(obj/mecha/combat/honker/M)
|
|
if(..())
|
|
if(istype(M))
|
|
return 1
|
|
return 0
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/punching_glove/action(target)
|
|
. = ..()
|
|
if(.)
|
|
chassis.occupant_message("<font color='red' size='5'>HONK</font>")
|
|
|
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/punching_glove/proj_init(obj/item/punching_glove/PG)
|
|
if(!istype(PG))
|
|
return
|
|
//has to be low sleep or it looks weird, the beam doesn't exist for very long so it's a non-issue
|
|
chassis.Beam(PG, icon_state = "chain", time = missile_range * 20, maxdistance = missile_range + 2, beam_sleep_time = 1)
|
|
|
|
/obj/item/punching_glove
|
|
name = "punching glove"
|
|
desc = "INCOMING HONKS"
|
|
throwforce = 35
|
|
icon_state = "punching_glove"
|
|
|
|
/obj/item/punching_glove/throw_impact(atom/hit_atom)
|
|
if(!..())
|
|
if(ismovableatom(hit_atom))
|
|
var/atom/movable/AM = hit_atom
|
|
AM.safe_throw_at(get_edge_target_turf(AM,get_dir(src, AM)), 7, 2)
|
|
qdel(src)
|