Skip to content

Commit

Permalink
MP QoL : part 1 (cmss13-devs#5554)
Browse files Browse the repository at this point in the history
Adds special effects to Taser and stunbaton.
Stunbaton can now be used if its already turned even if you have no
police skill or access.
Using a Stunbaton winout the required Skill has a high chance on hitting
yourself and dealing damage.
Disabler now deals a small amount of Oxy damage on hit.

adds QoL effects and a more credible skill-lock than a magic machine
shooting sparks.
this is part one on some content updates i plan to do on MPs to make
their gameplay more funny.

This PR Doesnt really affect nothing on the main gameplay loop its
mostly MP snowflake.

<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>

:cl:
add: Disabler bolts now deal a little oxygen damage on each hit.
add: Replaces Skill lock system on stunbatons with a high chance of
hiting yourself
qol: adds jittery and sway to Stunbaton and Disabler beams

/:cl:
  • Loading branch information
Diegoflores31 authored and Guidesu committed Feb 10, 2024
1 parent 4c8166c commit da1ac0d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 79 deletions.
11 changes: 0 additions & 11 deletions code/datums/agents/tools/stunbaton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,3 @@
hitcost = 500
stunforce = 40
has_user_lock = FALSE

/obj/item/weapon/baton/antag/check_user_auth(mob/user)
if(!skillcheckexplicit(user, SKILL_ANTAG, SKILL_ANTAG_AGENT))
user.visible_message(SPAN_NOTICE("[src] beeps as [user] picks it up"), SPAN_DANGER("WARNING: Unauthorized user detected. Denying access..."))
user.apply_effect(10, DAZE)
user.visible_message(SPAN_WARNING("[src] beeps and sends a shock through [user]'s body!"))
deductcharge(hitcost)

return FALSE

return TRUE
13 changes: 7 additions & 6 deletions code/datums/ammo/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@
icon_state = "stun"
damage_type = OXY
flags_ammo_behavior = AMMO_ENERGY|AMMO_IGNORE_RESIST|AMMO_ALWAYS_FF //Not that ignoring will do much right now.

stamina_damage = 45
damage = 15 //excessive use COULD be lethal
stamina_damage = 40
accuracy = HIT_ACCURACY_TIER_8
shell_speed = AMMO_SPEED_TIER_1 // Slightly faster
hit_effect_color = "#FFFF00"

/datum/ammo/energy/taser/on_hit_mob(mob/M, obj/projectile/P)
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.disable_special_items() // Disables scout cloak
/datum/ammo/energy/taser/on_hit_mob(mob/mobs, obj/projectile/P)
if(ishuman(mobs))
var/mob/living/carbon/human/humanus = mobs
humanus.disable_special_items() // Disables scout cloak
humanus.make_jittery(40)

/datum/ammo/energy/taser/precise
name = "precise taser bolt"
Expand Down
98 changes: 36 additions & 62 deletions code/game/objects/items/weapons/stunbaton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
icon_state = "stunbaton"
item_state = "baton"
flags_equip_slot = SLOT_WAIST
force = 15
sharp = 0
edge = 0
throwforce = 7
force = 20
sharp = FALSE
edge = FALSE
throwforce = 10
w_class = SIZE_MEDIUM

attack_verb = list("beaten")
req_one_access = list(ACCESS_MARINE_BRIG, ACCESS_MARINE_ARMORY, ACCESS_MARINE_SENIOR, ACCESS_WY_GENERAL, ACCESS_WY_SECURITY, ACCESS_CIVILIAN_BRIG)
var/stunforce = 50
var/status = 0 //whether the thing is on or not
var/status = FALSE //whether the thing is on or not
var/obj/item/cell/bcell = null
var/hitcost = 1000 //oh god why do power cells carry so much charge? We probably need to make a distinction between "industrial" sized power cells for APCs and power cells for everything else.
var/has_user_lock = TRUE //whether the baton prevents people without correct access from using it.
Expand Down Expand Up @@ -58,37 +58,6 @@
else
. += SPAN_WARNING("The baton does not have a power source installed.")

/obj/item/weapon/baton/attack_hand(mob/user)
if(check_user_auth(user))
..()


/obj/item/weapon/baton/equipped(mob/user, slot)
..()
check_user_auth(user)


//checks if the mob touching the baton has proper access
/obj/item/weapon/baton/proc/check_user_auth(mob/user)
if(!has_user_lock)
return TRUE
var/mob/living/carbon/human/H = user
if(istype(H))
var/obj/item/card/id/I = H.wear_id
if(!istype(I) || !check_access(I) && status)
var/datum/effect_system/spark_spread/s = new
s.set_up(5, 1, src.loc)
H.visible_message(SPAN_NOTICE("[src] beeps as [H] picks it up"), SPAN_DANGER("WARNING: Unauthorized user detected. Denying access..."))
H.visible_message(SPAN_WARNING("[src] beeps and sends a shock through [H]'s body!"))
H.emote("pain")
s.start()
deductcharge(hitcost)
add_fingerprint(user)
return FALSE
return TRUE
/obj/item/weapon/baton/pull_response(mob/puller)
return check_user_auth(puller)

/obj/item/weapon/baton/attackby(obj/item/W, mob/user)

if(istype(W, /obj/item/cell))
Expand Down Expand Up @@ -132,17 +101,20 @@
add_fingerprint(user)


/obj/item/weapon/baton/attack(mob/M, mob/user)
if(has_user_lock && !skillcheck(user, SKILL_POLICE, SKILL_POLICE_SKILLED))
to_chat(user, SPAN_WARNING("You don't seem to know how to use [src]..."))
return

if(isrobot(M))
..()
return

var/stun = stunforce
var/mob/living/L = M
/obj/item/weapon/baton/attack(mob/target, mob/user)
var/mob/living/carbon/human/real_user = user
var/mob/living/carbon/human/human_target = target
if(has_user_lock && !skillcheck(real_user, SKILL_POLICE, SKILL_POLICE_SKILLED))
if(prob(70) && status)
to_chat(real_user, SPAN_WARNING("You hit yourself with the [src] during the struggle..."))
real_user.drop_held_item()
real_user.apply_effect(1,STUN)
human_target = real_user
if(prob(20) && !status) //a relatively reliable melee weapon when turned off.
to_chat(real_user, SPAN_WARNING("You grab the [src] incorrectly twisting your hand in the process."))
real_user.drop_held_item()
real_user.apply_effect(1,STUN)
real_user.apply_damage(force, BRUTE, pick("l_hand","r_hand"), no_limb_loss = TRUE)

var/target_zone = check_zone(user.zone_selected)
if(user.a_intent == INTENT_HARM)
Expand All @@ -154,40 +126,42 @@

else
//copied from human_defense.dm - human defence code should really be refactored some time.
if (ishuman(L))
if (ishuman(human_target))

if(!target_zone) //shouldn't ever happen
L.visible_message(SPAN_DANGER("<B>[user] misses [L] with \the [src]!"))
human_target.visible_message(SPAN_DANGER("<B>[user] misses [human_target] with \the [src]!"))
return FALSE

var/mob/living/carbon/human/H = L
var/mob/living/carbon/human/H = human_target
var/obj/limb/affecting = H.get_limb(target_zone)
if (affecting)
if(!status)
L.visible_message(SPAN_WARNING("[L] has been prodded in the [affecting.display_name] with [src] by [user]. Luckily it was off."))
human_target.visible_message(SPAN_WARNING("[human_target] has been prodded in the [affecting.display_name] with [src] by [user]. Luckily it was off."))
return TRUE
else
H.visible_message(SPAN_DANGER("[L] has been prodded in the [affecting.display_name] with [src] by [user]!"))
H.visible_message(SPAN_DANGER("[human_target] has been prodded in the [affecting.display_name] with [src] by [user]!"))
else
if(!status)
L.visible_message(SPAN_WARNING("[L] has been prodded with [src] by [user]. Luckily it was off."))
human_target.visible_message(SPAN_WARNING("[human_target] has been prodded with [src] by [user]. Luckily it was off."))
return TRUE
else
L.visible_message(SPAN_DANGER("[L] has been prodded with [src] by [user]!"))
human_target.visible_message(SPAN_DANGER("[human_target] has been prodded with [src] by [user]!"))

//stun effects

if(!isyautja(L) && !isxeno(L)) //Xenos and Predators are IMMUNE to all baton stuns.
L.emote("pain")
L.apply_stamina_damage(stun, target_zone, ARMOR_ENERGY)
if(!isyautja(human_target) && !isxeno(human_target)) //Xenos and Predators are IMMUNE to all baton stuns.
human_target.emote("pain")
human_target.apply_stamina_damage(stunforce, target_zone, ARMOR_ENERGY)
human_target.sway_jitter(2,1)


// Logging
if(user == L)
user.attack_log += "\[[time_stamp()]\] <b>[key_name(user)]</b> stunned themselves with the [src] in [get_area(user)]"
if(user == human_target)
user.attack_log += "\[[time_stamp()]\] <b>[key_name(user)]</b> stunned themselves with [src] in [get_area(user)]"
else
msg_admin_attack("[key_name(user)] stunned [key_name(L)] with the [src] in [get_area(user)] ([user.loc.x],[user.loc.y],[user.loc.z]).", user.loc.x, user.loc.y, user.loc.z)
var/logentry = "\[[time_stamp()]\] <b>[key_name(user)]</b> stunned <b>[key_name(L)]</b> with the [src] in [get_area(user)]"
L.attack_log += logentry
msg_admin_attack("[key_name(user)] stunned [key_name(human_target)] with [src] in [get_area(user)] ([user.loc.x],[user.loc.y],[user.loc.z]).", user.loc.x, user.loc.y, user.loc.z)
var/logentry = "\[[time_stamp()]\] <b>[key_name(user)]</b> stunned <b>[key_name(human_target)]</b> with [src] in [get_area(user)]"
human_target.attack_log += logentry
user.attack_log += logentry

playsound(loc, 'sound/weapons/Egloves.ogg', 25, 1, 6)
Expand Down

0 comments on commit da1ac0d

Please sign in to comment.