Completely reworks the plasma pistol, adds the dropwall shield generator (Serious) (#17556)
* oi you got a loicnse for that * Final touches on plasma bar sound/sprite, hot drops hot drop walls * Actually makes dropwalls good™️ * s p r i t e s and fixes * Gives vox / drask hand gun sprites * forgot cult shield, ICONS added with pain * Last minute fixes and deploy coder sprites * spacing Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> * Removes comments, improves deployment and sprite handling * Removes direction_check * Uses signals, various changes * Final™️ changes * Final™️ Final™️ Changes * Final™️ Final™️ Final™️ Changes * [insert final™️ x4 joke here] * Final™️ Change. *6 Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
@@ -13201,12 +13201,12 @@
|
||||
/area/holodeck/source_beach)
|
||||
"Zw" = (
|
||||
/obj/structure/closet/secure_closet/guncabinet,
|
||||
/obj/item/gun/energy/toxgun{
|
||||
/obj/item/gun/energy/plasma_pistol{
|
||||
pixel_x = -3;
|
||||
pixel_y = 3
|
||||
},
|
||||
/obj/item/gun/energy/toxgun,
|
||||
/obj/item/gun/energy/toxgun{
|
||||
/obj/item/gun/energy/plasma_pistol,
|
||||
/obj/item/gun/energy/plasma_pistol{
|
||||
pixel_x = 3;
|
||||
pixel_y = -3
|
||||
},
|
||||
|
||||
@@ -408,6 +408,8 @@
|
||||
#define COMSIG_CARBON_EMBED_RIP "item_embed_start_rip"
|
||||
///called when removing a given item from a mob, from mob/living/carbon/remove_embedded_object(mob/living/carbon/target, /obj/item)
|
||||
#define COMSIG_CARBON_EMBED_REMOVAL "item_embed_remove_safe"
|
||||
/// From /mob/living/carbon/swap_hand(): Called when the user swaps their active hand
|
||||
#define COMSIG_CARBON_SWAP_HANDS "carbon_swap_hands"
|
||||
|
||||
// /mob/living/simple_animal/hostile signals
|
||||
#define COMSIG_HOSTILE_ATTACKINGTARGET "hostile_attackingtarget"
|
||||
|
||||
@@ -1530,6 +1530,14 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 20
|
||||
|
||||
/datum/uplink_item/device_tools/dropwall
|
||||
name = "Dropwall generator box"
|
||||
desc = "A box of 5 dropwall shield generators, which can be used to make temporary directional shields that block projectiles, thrown objects, and reduce explosions. Configure the direction before throwing."
|
||||
item = /obj/item/storage/box/syndie_kit/dropwall
|
||||
reference = "ESD"
|
||||
cost = 10
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/device_tools/medgun
|
||||
name = "Medbeam Gun"
|
||||
desc = "Medical Beam Gun, useful in prolonged firefights. DO NOT CROSS THE BEAMS. Crossing beams with another medbeam or attaching two beams to one target will have explosive consequences."
|
||||
|
||||
@@ -168,6 +168,10 @@
|
||||
current_charges--
|
||||
playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
new /obj/effect/temp_visual/cult/sparks(get_turf(owner))
|
||||
if(istype(hitby, /obj/item/projectile))
|
||||
var/obj/item/projectile/P = hitby
|
||||
if(P.shield_buster)
|
||||
current_charges = 0 //Change it to remove 3 charges if it ever has its max shield limit increased above 3.
|
||||
if(!current_charges)
|
||||
owner.visible_message("<span class='danger'>The runed shield around [owner] suddenly disappears!</span>")
|
||||
shield_state = "broken"
|
||||
@@ -467,7 +471,7 @@
|
||||
// 10 * 3 gives it a 30% chance to shatter per hit.
|
||||
shatter_chance = min((P.damage - threshold) * 3, 75) // Maximum of 75% chance
|
||||
|
||||
if(prob(shatter_chance))
|
||||
if(prob(shatter_chance) || P.shield_buster)
|
||||
var/turf/T = get_turf(owner)
|
||||
T.visible_message("<span class='warning'>The sheer force from [P] shatters the mirror shield!</span>")
|
||||
new /obj/effect/temp_visual/cult/sparks(T)
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#define WOOD 2
|
||||
#define SAND 3
|
||||
|
||||
#define DROPWALL_UPTIME 12
|
||||
|
||||
//Barricades/cover
|
||||
|
||||
/obj/structure/barricade
|
||||
@@ -18,13 +20,16 @@
|
||||
var/bar_material = METAL
|
||||
var/drop_amount = 3
|
||||
var/stacktype = /obj/item/stack/sheet/metal
|
||||
/// This variable is used to allow projectiles to always shoot through a barrier from a certain direction
|
||||
var/directional_blockage = FALSE
|
||||
//The list of directions to block a projectile from
|
||||
var/list/directional_list = list()
|
||||
|
||||
/obj/structure/barricade/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
make_debris()
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/structure/barricade/proc/make_debris()
|
||||
if(stacktype)
|
||||
new stacktype(get_turf(src), drop_amount)
|
||||
@@ -53,15 +58,22 @@
|
||||
if(!anchored)
|
||||
return TRUE
|
||||
var/obj/item/projectile/proj = mover
|
||||
if(directional_blockage)
|
||||
if(one_eighty_check(mover))
|
||||
return FALSE
|
||||
if(proj.firer && Adjacent(proj.firer))
|
||||
return TRUE
|
||||
if(prob(proj_pass_rate))
|
||||
return TRUE
|
||||
return FALSE
|
||||
else
|
||||
return !density
|
||||
|
||||
if(isitem(mover)) //thrown items with the dropwall
|
||||
if(directional_blockage)
|
||||
if(one_eighty_check(mover))
|
||||
return FALSE
|
||||
return !density
|
||||
|
||||
/obj/structure/barricade/proc/one_eighty_check(atom/movable/mover)
|
||||
return turn(mover.dir, 180) in directional_list
|
||||
|
||||
/////BARRICADE TYPES///////
|
||||
|
||||
@@ -210,6 +222,168 @@
|
||||
/obj/structure/barricade/mime/mrcd
|
||||
stacktype = null
|
||||
|
||||
/obj/structure/barricade/dropwall
|
||||
name = "dropwall"
|
||||
desc = "A temporary deployable energy shield powered by a generator. Breaking the generator will destroy all the shields connected to it."
|
||||
icon = 'icons/obj/dropwall.dmi'
|
||||
icon_state = "dropwall_dead" //sprite chosen in init
|
||||
density = FALSE
|
||||
directional_blockage = TRUE
|
||||
proj_pass_rate = 100 //don't worry about it, covered by directional blockage.
|
||||
stacktype = null
|
||||
/// This variable is used to tell the shield to ping it's owner when it is broke.
|
||||
var/core_shield = FALSE
|
||||
/// This variable is to tell the shield what it's source is.
|
||||
var/obj/structure/dropwall_generator/source = null
|
||||
explosion_block = 8 //should be enough for a potasium water nade that isn't a maxcap. If you stand next to a maxcap with this however, it will end poorly
|
||||
|
||||
/obj/structure/barricade/dropwall/Initialize(mapload, owner, core, dir_1, dir_2)
|
||||
. = ..()
|
||||
source = owner
|
||||
core_shield = core
|
||||
directional_list += dir_1
|
||||
directional_list += dir_2
|
||||
if(dir_2)
|
||||
icon_state = "[dir2text(dir_1 + dir_2)]"
|
||||
else
|
||||
icon_state = "[dir2text(dir_1)]"
|
||||
|
||||
/obj/structure/barricade/dropwall/Destroy()
|
||||
if(core_shield)
|
||||
source.protected = FALSE
|
||||
source = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/barricade/dropwall/emp_act(severity)
|
||||
..()
|
||||
take_damage(40 / severity, BRUTE) //chances are the EMP will also hit the generator, we don't want it to double up too heavily
|
||||
|
||||
/obj/structure/barricade/dropwall/bullet_act(obj/item/projectile/P)
|
||||
if(P.shield_buster)
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/grenade/barrier/dropwall
|
||||
name = "dropwall shield generator"
|
||||
desc = "This generator designed by Shellguard Munitions's spartan division is used to deploy a temporary cover that blocks projectiles and explosions from a direction, while allowing projectiles to pass freely from behind."
|
||||
actions_types = list(/datum/action/item_action/toggle_barrier_spread)
|
||||
icon = 'icons/obj/dropwall.dmi'
|
||||
icon_state = "dropwall"
|
||||
mode = NORTH
|
||||
var/uptime = DROPWALL_UPTIME SECONDS
|
||||
|
||||
/obj/item/grenade/barrier/dropwall/toggle_mode(mob/user)
|
||||
switch(mode)
|
||||
if(NORTH)
|
||||
mode = EAST
|
||||
if(EAST)
|
||||
mode = SOUTH
|
||||
if(SOUTH)
|
||||
mode = WEST
|
||||
if(WEST)
|
||||
mode = NORTH
|
||||
|
||||
to_chat(user, "[src] is now in [dir2text(mode)] mode.")
|
||||
|
||||
/obj/item/grenade/barrier/dropwall/prime()
|
||||
new /obj/structure/dropwall_generator(get_turf(loc), mode, uptime)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/dropwall_generator
|
||||
name = "deployed dropwall shield generator"
|
||||
desc = "This generator designed by Shellguard Munitions's spartan division is used to deploy a temporary cover that blocks projectiles and explosions from a direction, while allowing projectiles to pass freely from behind."
|
||||
icon = 'icons/obj/dropwall.dmi'
|
||||
icon_state = "dropwall_deployed"
|
||||
max_integrity = 25 // 2 shots
|
||||
var/list/connected_shields = list()
|
||||
/// This variable is used to prevent damage to it's core shield when it is up.
|
||||
var/protected = FALSE
|
||||
///The core shield that protects the generator
|
||||
var/obj/structure/barricade/dropwall/core_shield = null
|
||||
|
||||
/obj/structure/dropwall_generator/Initialize(mapload, direction, uptime)
|
||||
. = ..()
|
||||
if(direction)
|
||||
deploy(direction, uptime)
|
||||
|
||||
/obj/structure/dropwall_generator/Destroy()
|
||||
QDEL_LIST(connected_shields)
|
||||
core_shield = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/dropwall_generator/proc/deploy(direction, uptime)
|
||||
anchored = TRUE
|
||||
protected = TRUE
|
||||
addtimer(CALLBACK(src, .proc/power_out), uptime)
|
||||
timer_overlay_proc(uptime/10)
|
||||
|
||||
connected_shields += new /obj/structure/barricade/dropwall(get_turf(loc), src, TRUE, direction)
|
||||
core_shield = connected_shields[1]
|
||||
|
||||
var/dir_left = turn(direction, -90)
|
||||
var/dir_right = turn(direction, 90)
|
||||
var/target_turf = get_step(src, dir_left)
|
||||
if(!is_blocked_turf(target_turf))
|
||||
connected_shields += new /obj/structure/barricade/dropwall(target_turf, src, FALSE, direction, dir_left)
|
||||
|
||||
var/target_turf2 = get_step(src, dir_right)
|
||||
if(!is_blocked_turf(target_turf2))
|
||||
connected_shields += new /obj/structure/barricade/dropwall(target_turf2, src, FALSE, direction, dir_right)
|
||||
|
||||
|
||||
/obj/structure/dropwall_generator/attacked_by(obj/item/I, mob/living/user) //No, you can not just go up to the generator and whack it. Central shield needs to go down first.
|
||||
if(protected)
|
||||
visible_message("<span class='warning'>[src]'s shield absorbs the blow!</span>")
|
||||
core_shield.take_damage(I.force, I.damtype, MELEE, TRUE)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/dropwall_generator/bullet_act(obj/item/projectile/P)
|
||||
if(!protected)
|
||||
return ..()
|
||||
else
|
||||
visible_message("<span class='warning'>[src]'s shield absorbs the blow!</span>")
|
||||
core_shield.take_damage(P.damage, P.damage_type, P.flag)
|
||||
|
||||
/obj/structure/dropwall_generator/emp_act(severity)
|
||||
..()
|
||||
if(protected)
|
||||
for(var/obj/structure/barricade/dropwall/O in connected_shields)
|
||||
O.emp_act(severity)
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/dropwall_generator/proc/power_out()
|
||||
visible_message("<span class='warning'>[src] runs out of power, causing its shields to fail!</span>")
|
||||
new /obj/item/used_dropwall(get_turf(src))
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/dropwall_generator/proc/timer_overlay_proc(uptime) // This proc will make the timer on the generator tick down like a clock, over 12 equally sized portions (12 times over 12 seconds, every second by default)
|
||||
var/cycle = DROPWALL_UPTIME + 1 - uptime
|
||||
add_overlay("[cycle]")
|
||||
if(cycle != 1)
|
||||
cut_overlay("[(cycle - 1)]")
|
||||
if(cycle < 12)
|
||||
addtimer(CALLBACK(src, .proc/timer_overlay_proc, uptime - 1), DROPWALL_UPTIME / 12 SECONDS)
|
||||
|
||||
|
||||
/obj/item/used_dropwall
|
||||
name = "broken dropwall generator"
|
||||
desc = "This dropwall has ran out of charge, but some materials could possibly be reclamed."
|
||||
icon = 'icons/obj/dropwall.dmi'
|
||||
icon_state = "dropwall_dead"
|
||||
item_state = "flashbang"
|
||||
materials = list(MAT_METAL = 4000, MAT_GLASS = 2500) //plasma burned up for power or something, plus not that much to reclaim
|
||||
|
||||
|
||||
/obj/item/storage/box/syndie_kit/dropwall
|
||||
name = "dropwall generator box"
|
||||
|
||||
/obj/item/storage/box/syndie_kit/dropwall/populate_contents()
|
||||
for(var/I in 1 to 5)
|
||||
new /obj/item/grenade/barrier/dropwall(src)
|
||||
|
||||
#undef SINGLE
|
||||
#undef VERTICAL
|
||||
#undef HORIZONTAL
|
||||
@@ -217,3 +391,6 @@
|
||||
#undef METAL
|
||||
#undef WOOD
|
||||
#undef SAND
|
||||
|
||||
|
||||
#undef DROPWALL_UPTIME
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
var/datum/effect_system/spark_spread/sparks = new
|
||||
sparks.set_up(n, c, source)
|
||||
sparks.autocleanup = TRUE
|
||||
sparks.start()
|
||||
INVOKE_ASYNC(sparks, /datum/effect_system/.proc/start)
|
||||
|
||||
/obj/effect/particle_effect/sparks
|
||||
name = "sparks"
|
||||
|
||||
@@ -70,13 +70,21 @@
|
||||
var/active = 0
|
||||
|
||||
/obj/item/shield/energy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
if(istype(hitby, /obj/item/projectile))
|
||||
var/obj/item/projectile/P = hitby
|
||||
if(P.shield_buster && active)
|
||||
toggle(owner, TRUE)
|
||||
to_chat(owner, "<span class='warning'>[hitby] overloaded your [src]!</span>")
|
||||
return 0
|
||||
|
||||
/obj/item/shield/energy/IsReflect()
|
||||
return (active)
|
||||
|
||||
/obj/item/shield/energy/attack_self(mob/living/carbon/human/user)
|
||||
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
|
||||
toggle(user, FALSE)
|
||||
|
||||
/obj/item/shield/energy/proc/toggle(mob/living/carbon/human/user, forced)
|
||||
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50) && !forced)
|
||||
to_chat(user, "<span class='warning'>You beat yourself in the head with [src].</span>")
|
||||
user.take_organ_damage(5)
|
||||
active = !active
|
||||
@@ -100,9 +108,9 @@
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.update_inv_l_hand()
|
||||
H.update_inv_r_hand()
|
||||
add_fingerprint(user)
|
||||
if(!forced)
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/shield/riot/tele
|
||||
name = "telescopic shield"
|
||||
desc = "An advanced riot shield made of lightweight materials that collapses for easy storage."
|
||||
|
||||
@@ -633,6 +633,10 @@
|
||||
current_charges--
|
||||
if(recharge_rate)
|
||||
START_PROCESSING(SSobj, src)
|
||||
if(istype(hitby, /obj/item/projectile))
|
||||
var/obj/item/projectile/P = hitby
|
||||
if(P.shield_buster)
|
||||
current_charges = max(0, current_charges - 3)
|
||||
if(current_charges <= 0)
|
||||
owner.visible_message("<span class='warning'>[owner]'s shield overloads!</span>")
|
||||
shield_state = "broken"
|
||||
|
||||
@@ -196,6 +196,7 @@
|
||||
H.update_icon()
|
||||
H = hud_used.inv_slots[slot_r_hand]
|
||||
H.update_icon()
|
||||
SEND_SIGNAL(src, COMSIG_CARBON_SWAP_HANDS)
|
||||
|
||||
|
||||
/mob/living/carbon/activate_hand(selhand) //0 or "r" or "right" for right hand; 1 or "l" or "left" for left hand.
|
||||
|
||||
@@ -245,11 +245,19 @@
|
||||
muzzle_flash_color = LIGHT_COLOR_FADEDPURPLE
|
||||
projectile_type = /obj/item/projectile/energy/shock_revolver
|
||||
|
||||
/obj/item/ammo_casing/energy/toxplasma
|
||||
projectile_type = /obj/item/projectile/energy/toxplasma
|
||||
/obj/item/ammo_casing/energy/weak_plasma
|
||||
projectile_type = /obj/item/projectile/energy/weak_plasma
|
||||
e_cost = 75 // With no charging, 162.5 damage from 13 shots.
|
||||
muzzle_flash_color = LIGHT_COLOR_FADEDPURPLE
|
||||
fire_sound = 'sound/weapons/taser2.ogg'
|
||||
select_name = "plasma dart"
|
||||
select_name = null //If the select name is null, it does not send a message of switching modes to the user, important on the pistol.
|
||||
|
||||
/obj/item/ammo_casing/energy/charged_plasma
|
||||
projectile_type = /obj/item/projectile/energy/charged_plasma
|
||||
e_cost = 0 //Charge is used when you charge the gun. Prevents issues.
|
||||
muzzle_flash_color = LIGHT_COLOR_FADEDPURPLE
|
||||
fire_sound = 'sound/weapons/marauder.ogg' //Should be different enough to get attention
|
||||
select_name = null
|
||||
|
||||
/obj/item/ammo_casing/energy/clown
|
||||
projectile_type = /obj/item/projectile/clown
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#define PLASMA_CHARGE_USE_PER_SECOND 2.5
|
||||
#define PLASMA_DISCHARGE_LIMIT 5
|
||||
|
||||
// Ion Rifles //
|
||||
/obj/item/gun/energy/ionrifle
|
||||
name = "ion rifle"
|
||||
@@ -303,17 +306,142 @@
|
||||
ammo_x_offset = 3
|
||||
can_holster = TRUE // you'll never see it coming
|
||||
|
||||
/obj/item/gun/energy/toxgun
|
||||
/obj/item/gun/energy/plasma_pistol
|
||||
name = "plasma pistol"
|
||||
desc = "A specialized firearm designed to fire lethal bolts of toxins."
|
||||
desc = "A specialized firearm designed to fire heated bolts of plasma. Can be overloaded for a high damage shield breaking shot."
|
||||
icon_state = "toxgun"
|
||||
fire_sound = 'sound/effects/stealthoff.ogg'
|
||||
|
||||
item_state = "toxgun"
|
||||
sprite_sheets_inhand = list("Vox" = 'icons/mob/clothing/species/vox/held.dmi', "Drask" = 'icons/mob/clothing/species/drask/held.dmi') //This apperently exists, and I have the sprites so sure.
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
origin_tech = "combat=4;magnets=4;powerstorage=3"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/toxplasma)
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/weak_plasma, /obj/item/ammo_casing/energy/charged_plasma)
|
||||
shaded_charge = 1
|
||||
can_holster = TRUE
|
||||
atom_say_verb = "beeps"
|
||||
bubble_icon = "swarmer"
|
||||
light_color = "#89078E"
|
||||
light_power = 4
|
||||
var/overloaded = FALSE
|
||||
var/warned = FALSE
|
||||
var/charging = FALSE
|
||||
var/mob/living/carbon/holder = null
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/Initialize(mapload)
|
||||
. = ..()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/Destroy()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
holder = null
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/process()
|
||||
..()
|
||||
if(overloaded)
|
||||
cell.charge -= PLASMA_CHARGE_USE_PER_SECOND / 5 //2.5 per second, 25 every 10 seconds
|
||||
if(cell.charge <= PLASMA_CHARGE_USE_PER_SECOND * 10 && !warned)
|
||||
warned = TRUE
|
||||
playsound(loc, 'sound/weapons/smg_empty_alarm.ogg', 75, 1)
|
||||
atom_say("Caution, charge low. Forced discharge in under 10 seconds.")
|
||||
if(cell.charge <= PLASMA_DISCHARGE_LIMIT)
|
||||
discharge()
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/attack_self(mob/living/user)
|
||||
if(overloaded)
|
||||
to_chat(user, "<span class='warning'>[src] is already overloaded!</span>")
|
||||
return
|
||||
if(cell.charge <= 140) //at least 6 seconds of charge time
|
||||
to_chat(user, "<span class='warning'>[src] does not have enough charge to be overloaded.</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You begin to overload [src].</span>")
|
||||
charging = TRUE
|
||||
if(do_after(user, 2.5 SECONDS, target = src))
|
||||
select_fire(user)
|
||||
overloaded = TRUE
|
||||
cell.charge -= 125
|
||||
playsound(loc, 'sound/machines/terminal_prompt_confirm.ogg', 75, 1)
|
||||
atom_say("Overloading successful.")
|
||||
set_light(3) //extra visual effect to make it more noticable to user and victims alike
|
||||
holder = user
|
||||
RegisterSignal(holder, COMSIG_CARBON_SWAP_HANDS, .proc/discharge)
|
||||
charging = FALSE
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/proc/reset_overloaded()
|
||||
select_fire()
|
||||
set_light(0)
|
||||
overloaded = FALSE
|
||||
warned = FALSE
|
||||
UnregisterSignal(holder, COMSIG_CARBON_SWAP_HANDS)
|
||||
holder = null
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/process_fire(atom/target, mob/living/user, message = TRUE, params, zone_override, bonus_spread = 0)
|
||||
if(charging)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/process_chamber()
|
||||
if(overloaded)
|
||||
do_sparks(2, 1, src)
|
||||
reset_overloaded()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/emp_act(severity)
|
||||
..()
|
||||
if(prob(100 / severity) && overloaded)
|
||||
discharge()
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/dropped(mob/user)
|
||||
. = ..()
|
||||
if(overloaded)
|
||||
discharge()
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/equipped(mob/user, slot, initial)
|
||||
. = ..()
|
||||
if(overloaded)
|
||||
discharge()
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/proc/discharge() //25% of the time, plasma leak. Otherwise, shoot at a random mob / turf nearby. If no proper mob is found when mob is picked, fire at a turf instead
|
||||
SIGNAL_HANDLER
|
||||
reset_overloaded()
|
||||
do_sparks(2, 1, src)
|
||||
update_icon()
|
||||
if(prob(25))
|
||||
visible_message("<span class='danger'>[src] vents heated plasma!</span>")
|
||||
var/turf/simulated/T = get_turf(src)
|
||||
if(istype(T))
|
||||
T.atmos_spawn_air(LINDA_SPAWN_TOXINS|LINDA_SPAWN_20C,15)
|
||||
return
|
||||
if(prob(50))
|
||||
var/list/mob_targets = list()
|
||||
for(var/mob/living/M in oview(get_turf(src), 7))
|
||||
mob_targets += M
|
||||
if(length(mob_targets))
|
||||
var/mob/living/target = pick(mob_targets)
|
||||
shootAt(target)
|
||||
visible_message("<span class='danger'>[src] discharges a plasma bolt!</span>")
|
||||
return
|
||||
|
||||
visible_message("<span class='danger'>[src] discharges a plasma bolt!</span>")
|
||||
var/list/turf_targets = list()
|
||||
for(var/turf/T in orange(get_turf(src), 7))
|
||||
turf_targets += T
|
||||
if(length(turf_targets))
|
||||
var/turf/target = pick(turf_targets)
|
||||
shootAt(target)
|
||||
|
||||
|
||||
/obj/item/gun/energy/plasma_pistol/proc/shootAt(atom/movable/target)
|
||||
var/turf/T = get_turf(src)
|
||||
var/turf/U = get_turf(target)
|
||||
if(!T || !U)
|
||||
return
|
||||
var/obj/item/projectile/energy/charged_plasma/O = new /obj/item/projectile/energy/charged_plasma(T)
|
||||
playsound(get_turf(src), 'sound/weapons/marauder.ogg', 75, 1)
|
||||
O.current = T
|
||||
O.yo = U.y - T.y
|
||||
O.xo = U.x - T.x
|
||||
O.fire()
|
||||
|
||||
/obj/item/gun/energy/bsg
|
||||
name = "\improper B.S.G"
|
||||
@@ -628,3 +756,6 @@
|
||||
var/obj/item/ammo_casing/energy/mimic/M = ammo_type[select]
|
||||
M.mimic_type = mimic_type
|
||||
..()
|
||||
|
||||
#undef PLASMA_CHARGE_USE_PER_SECOND
|
||||
#undef PLASMA_DISCHARGE_LIMIT
|
||||
|
||||
@@ -72,6 +72,9 @@
|
||||
/// Instructs forceMove to NOT reset our trajectory to the new location!
|
||||
var/trajectory_ignore_forcemove = FALSE
|
||||
|
||||
/// Does this projectile do extra damage to / break shields?
|
||||
var/shield_buster = FALSE
|
||||
|
||||
/obj/item/projectile/New()
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -134,9 +134,17 @@
|
||||
add_attack_logs(src, M, "Hit lightly by [src]")
|
||||
M.apply_damage(rand(1, 5), BURN)
|
||||
|
||||
/obj/item/projectile/energy/toxplasma
|
||||
/obj/item/projectile/energy/weak_plasma
|
||||
name = "plasma bolt"
|
||||
icon_state = "energy"
|
||||
damage = 20
|
||||
damage_type = TOX
|
||||
irradiate = 20
|
||||
icon_state = "plasma_light"
|
||||
damage = 12.5
|
||||
damage_type = BURN
|
||||
|
||||
/obj/item/projectile/energy/charged_plasma
|
||||
name = "charged plasma bolt"
|
||||
icon_state = "plasma_heavy"
|
||||
damage = 45
|
||||
damage_type = BURN
|
||||
armour_penetration = 10 // It can have a little armor pen, as a treat. Bigger than it looks, energy armor is often low.
|
||||
shield_buster = TRUE
|
||||
is_reflectable = FALSE //I will let eswords block it like a normal projectile, but it's not getting reflected, and eshields will take the hit hard.
|
||||
|
||||
@@ -133,12 +133,12 @@
|
||||
|
||||
/datum/design/plasmapistol
|
||||
name = "Plasma Pistol"
|
||||
desc = "A specialized firearm designed to fire lethal bolts of toxins."
|
||||
desc = "A specialized firearm designed to fire heated bolts of plasma. Can be charged up for a shield breaking shot."
|
||||
id = "ppistol"
|
||||
req_tech = list("combat" = 5, "magnets" = 5, "powerstorage" = 5)
|
||||
req_tech = list("combat" = 5, "magnets" = 5, "powerstorage" = 5, "plasmatech" = 5)
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 5000, MAT_GLASS = 1000, MAT_PLASMA = 3000)
|
||||
build_path = /obj/item/gun/energy/toxgun
|
||||
build_path = /obj/item/gun/energy/plasma_pistol
|
||||
locked = 1
|
||||
category = list("Weapons")
|
||||
|
||||
@@ -280,3 +280,13 @@
|
||||
build_path = /obj/item/gun/energy/bsg
|
||||
locked = TRUE
|
||||
category = list("Weapons")
|
||||
|
||||
/datum/design/dropwall
|
||||
name = "Dropwall Generator"
|
||||
desc = "A prototype shield generator design that was inspired by shellguard munitions spartan division. Generates a directional shield to block projectiles and explosions."
|
||||
id = "drop_wall"
|
||||
req_tech = list("combat" = 5, "materials" = 5, "engineering" = 5, "magnets" = 5)
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 8000, MAT_GLASS = 5000, MAT_SILVER = 500, MAT_TITANIUM = 500, MAT_PLASMA = 500)
|
||||
build_path = /obj/item/grenade/barrier/dropwall
|
||||
category = list("Weapons")
|
||||
|
||||
|
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 664 B |
|
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 686 B |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 40 KiB |