Skip to content

Commit

Permalink
Make changes to how Flockbits and Flockdrones use items and guns (#11684
Browse files Browse the repository at this point in the history
)
  • Loading branch information
FlameArrow57 committed Jan 15, 2023
1 parent 2b29451 commit b98ef95
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
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 @@ -966,6 +966,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()
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

0 comments on commit b98ef95

Please sign in to comment.