Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make changes to how Flockbits and Flockdrones use items and guns #11684

Merged
merged 9 commits into from Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/datums/limb.dm
Expand Up @@ -12,6 +12,8 @@
var/datum/item_special/disarm_special = null //Contains the datum which executes the items special, if it has one, when used beyond melee range.
var/datum/item_special/harm_special = null //Contains the datum which executes the items special, if it has one, when used beyond melee range.
var/can_pickup_item = TRUE
var/attack_strength_modifier = 1 // scale from 0 to 1 on how well this limb can attack/hit things with items
var/can_gun_grab = TRUE // if the limb can gun grab with a held gun

New(var/obj/item/parts/holder)
..()
Expand Down
2 changes: 2 additions & 0 deletions code/mob/living/critter/flock/flockdrone.dm
Expand Up @@ -929,6 +929,8 @@
/////////////////////////////////////////////////////////////////////////////////

/datum/limb/flock_grip // an ordinary hand but with some modified messages
attack_strength_modifier = 0.2
can_gun_grab = FALSE
var/attack_hit_prob = 50
var/grab_mob_hit_prob = 30
var/dam_low = 4 // 2 is human baseline
Expand Down
6 changes: 6 additions & 0 deletions code/obj/item.dm
Expand Up @@ -1255,6 +1255,10 @@
if(user.is_hulk())
power *= 1.5

var/datum/limb/attacking_limb = user?.equipped_limb()
FlameArrow57 marked this conversation as resolved.
Show resolved Hide resolved
var/attack_strength_mult = !isnull(attacking_limb) ? attacking_limb.attack_strength_modifier : 1
power *= attack_strength_mult

var/list/shield_amt = list()
SEND_SIGNAL(M, COMSIG_MOB_SHIELD_ACTIVATE, power, shield_amt)
power *= max(0, (1-shield_amt["shield_strength"]))
Expand Down Expand Up @@ -1292,6 +1296,8 @@
if(src.special.overrideStaminaDamage >= 0)
stam_power = src.special.overrideStaminaDamage

stam_power *= attack_strength_mult

//reduce stamina by the same proportion that base damage was reduced
//min cap is stam_power/2 so we still cant ignore it entirely
if ((power + armor_mod) == 0) //mbc lazy runtime fix
Expand Down
9 changes: 5 additions & 4 deletions code/obj/item/gun/gun_parent.dm
Expand Up @@ -272,10 +272,11 @@ var/list/forensic_IDs = new/list() //Global list of all guns, based on bioholder

if(user.a_intent != INTENT_HELP && isliving(M))
if (user.a_intent == INTENT_GRAB)
attack_particle(user,M)
return ..()
else
src.shoot_point_blank(M, user)
var/datum/limb/current_limb = user.equipped_limb()
if (current_limb.can_gun_grab)
attack_particle(user,M)
return ..()
src.shoot_point_blank(M, user)
else
..()
attack_particle(user,M)
Expand Down