* Evolution of Combat

* Tackling some problems

* Football alert

Co-authored-by: Rubylips <Questionfrog@gmail.com>
This commit is contained in:
GreatBigFailure
2021-09-12 00:29:34 -04:00
committed by GitHub
parent 44a160884d
commit 5c058b4ce2
11 changed files with 203 additions and 3 deletions

View File

@@ -118,6 +118,9 @@
return
if(in_throw_mode)
if(!get_active_hand() && (a_intent == I_GRAB || a_intent == I_DISARM))
doTackle(A)
else
throw_item(A)
return

View File

@@ -284,6 +284,12 @@
/obj/item/clothing/proc/get_armor_absorb(var/type)
return armor_absorb[type]
/obj/item/clothing/proc/offenseTackleBonus()
return
/obj/item/clothing/proc/defenseTackleBonus()
return
//Ears: headsets, earmuffs and tiny objects
/obj/item/clothing/ears
name = "ears"
@@ -498,6 +504,10 @@
/obj/item/clothing/shoes/proc/on_kick(mob/living/user, mob/living/victim)
return
/obj/item/clothing/shoes/defenseTackleBonus()
if(clothing_flags & MAGPULSE)
return 4
//Called from human_defense.dm proc foot_impact
/obj/item/clothing/shoes/proc/impact_dampen(atom/source, var/damage)
return damage

View File

@@ -30,6 +30,12 @@
body_parts_covered = FULL_HEAD|MASKHEADHAIR
eyeprot = 1
/obj/item/clothing/head/helmet/tactical/riot/offenseTackleBonus()
return 1
/obj/item/clothing/head/helmet/tactical/riot/defenseTackleBonus()
return 1
/obj/item/clothing/head/helmet/tactical/swat
name = "\improper SWAT helmet"
desc = "They're often used by highly trained Swat Members."

View File

@@ -21,6 +21,12 @@
message += " OLE!"
speech.message = message
/obj/item/clothing/mask/luchador/offenseTackleBonus()
return 1
/obj/item/clothing/mask/luchador/defenseTackleBonus()
return 1
/obj/item/clothing/mask/luchador/tecnicos
name = "Tecnicos Mask"
desc = "Worn by robust fighters who uphold justice and fight honorably."

View File

@@ -152,6 +152,12 @@
armor = list(melee = 80, bullet = 10, laser = 10, energy = 10, bomb = 0, bio = 0, rad = 0)
siemens_coefficient = 0.5
/obj/item/clothing/suit/armor/riot/offenseTackleBonus()
return 1
/obj/item/clothing/suit/armor/riot/defenseTackleBonus()
return 2
/obj/item/clothing/suit/armor/rune
name = "rune platebody"
desc = "Provides excellent protection."

View File

@@ -993,6 +993,9 @@
clothing_flags = ONESIZEFITSALL
species_fit = list(INSECT_SHAPED, VOX_SHAPED, GREY_SHAPED)
/obj/item/clothing/under/football/offenseTackleBonus()
return 1
/obj/item/clothing/under/football/New()
icon_state = "redfootball_[pick(23,13,69,56)]"
item_state = icon_state

View File

@@ -28,6 +28,7 @@
var/obj/item/device/station_map/displayed_holomap = null
var/target_zone = null
var/isTackling = FALSE
/mob/living/carbon/New(var/new_loc, var/new_species_name = null, var/delay_ready_dna=0)
..()

View File

@@ -92,3 +92,121 @@
return TRUE
else
return ..()
//Tackle procs/////
/mob/proc/doTackle(var/atom/A)
return
/mob/living/carbon/doTackle(var/atom/A)
if(throw_delayer.blocked())
return
delayNextThrow(10)
throw_mode_off()
if(!get_turf(src) || istype(get_turf(src), /turf/space))
to_chat(src, "<span class='warning'>You need more footing to do that!")
return
if(restrained() || lying || locked_to || stat)
return
var/tRange = calcTackleRange()
isTackling = TRUE
knockdown = max(knockdown, 2) //Not using the Knockdown() proc as it created odd behaviour with hulks and another knockdown immune
update_canmove()
throw_at(A, tRange, 1)
/mob/living/carbon/throw_impact(atom/hit_atom, speed, user)
if(isTackling)
if(!throwing)
isTackling = FALSE //Safety from throw_at being a jerk
else
var/tackleForce = calcTackleForce()
if(isliving(hit_atom))
add_attacklogs(src, hit_atom, "tackled")
var/mob/living/L = hit_atom
var/tackleDefense = L.calcTackleDefense()
var/rngForce = rand(tackleForce/2, tackleForce) //RNG or else most people would just bounce off each other.
var/rngDefense = rand(tackleDefense/2, tackleDefense)
var/tKnock = max(0, rngDefense - rngForce) //Calculating our knockdown, we always get knocked down at least a little
Knockdown(min(10, tKnock)) //To prevent eternity knockdown from tackling an 8 riot shield martian or something
tKnock = max(0, rngForce - rngDefense) //Calculating their knockdown, they might not get knocked down at all
if(tKnock)
L.Knockdown(min(10, tKnock))
if(M_HORNS in mutations)
tKnock += 5
L.adjustBruteLoss(tKnock)
spawn(3) //Just to let throw_impact stop throwing a tantrum
isTackling = FALSE
..()
/mob/living/carbon/to_bump(atom/Obstacle)
..()
if(isTackling)
if(!throwing)
isTackling = FALSE //Safety from throw_at being a jerk
else
var/tPain = rand(1,10)
adjustBruteLoss(tPain)
Knockdown(tPain/2)
/mob/living/carbon/calcTackleRange(var/tR = 0)
tR += bonusTackleRange()
if(isninja(src))
tR += 1 //Avoiding tR++ for readability and ease of editing later
if(M_RUN in mutations)
tR += 1
return tR
/mob/living/carbon/calcTackleForce(var/tForce = 0)
if(world.time > last_moved + 1 SECONDS) //If you haven't moved in the last second you do a weaker "standing tackle"
tForce -= 1
else
tForce += 1
tForce += get_strength()*2
tForce += offenseMutTackle()
tForce += bonusTackleForce()
return max(0, tForce)
/mob/living/carbon/proc/offenseMutTackle(var/tF = 0)
for(var/M in mutations)
switch(M)
if(M_HULK)
tF += 2 //hulk also contributes to get_strength() so the bonus is higher than appears here
if(M_FAT)
tF += 3
if(M_VEGAN)
tF -= 1
if(M_DWARF)
tF -= 2
return tF
/mob/living/carbon/calcTackleDefense(var/tDef = 0)
tDef += get_strength()
for(var/obj/item/weapon/I in held_items)
if(I.IsShield())
tDef += 4
tDef += defenseMutTackle()
tDef += bonusTackleDefense()
return max(0, tDef)
/mob/living/carbon/proc/defenseMutTackle(var/tD = 0)
for(var/M in mutations)
switch(M)
if(M_FAT)
tD += 2
if(M_VEGAN)
tD -= 1
if(M_CLUMSY) //The clown fears fatsec
tD -= 2
playsound(loc, 'sound/items/bikehorn.ogg', 20, 1)
if(M_DWARF)
tD -= 2
return tD
/mob/living/carbon/proc/bonusTackleForce(var/tF = 1)
return tF
/mob/living/carbon/proc/bonusTackleDefense(var/tD = 1)
return tD
/mob/living/carbon/proc/bonusTackleRange(var/tR = 1)
return tR

View File

@@ -265,3 +265,30 @@
/mob/living/carbon/human/on_dodge(attacker, attacking_object)
if(isninja(src))
emote("smirks", message = TRUE)
//Tackle procs//////
/mob/living/carbon/human/bonusTackleForce(var/tF = 0)
for(var/obj/item/clothing/C in get_all_slots())
if(istype(C))
tF += C.offenseTackleBonus()
if(species)
tF += species.tacklePower
return tF
/mob/living/carbon/human/bonusTackleDefense(var/tD = 0)
for(var/obj/item/clothing/C in get_all_slots())
if(istype(C))
tD += C.defenseTackleBonus()
if(species)
tD += species.tacklePower
return tD
/mob/living/carbon/human/bonusTackleRange(var/tR = 0)
if(species)
tR += species.tackleRange
if(wear_suit)
var/obj/item/slowSuit = wear_suit
if(slowSuit.slowdown > NO_SLOWDOWN)
tR -= 1
return max(0, tR)

View File

@@ -47,6 +47,8 @@ var/global/list/whitelisted_species = list("Human")
var/punch_sharpness = 0 // Slicing/cutting force of punches. Independent of the sharpness added by claws.
var/punch_throw_range = 0
var/punch_throw_speed = 1
var/tacklePower = 5
var/tackleRange = 2
var/mutantrace // Safeguard due to old code.
var/myhuman // mob reference
@@ -415,6 +417,8 @@ var/global/list/whitelisted_species = list("Human")
default_mutations=list(M_SKELETON)
brute_mod = 2.0
tacklePower = 2
tackleRange = 3 //How terribly spooky
has_organ = list(
"brain" = /datum/organ/internal/brain,
@@ -590,6 +594,7 @@ var/global/list/whitelisted_species = list("Human")
eyes = "grey_eyes_s"
max_hurt_damage = 3 // From 5 (for humans)
tacklePower = 2
primitive = /mob/living/carbon/monkey/grey
@@ -661,6 +666,7 @@ var/global/list/whitelisted_species = list("Human")
eyes = "eyes_s"
max_hurt_damage = 10
tacklePower = 9
primitive = /mob/living/carbon/monkey // TODO
@@ -720,7 +726,7 @@ var/global/list/whitelisted_species = list("Human")
deform = 'icons/mob/human_races/vox/r_def_vox.dmi'
known_languages = list(LANGUAGE_VOX)
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/rawchicken/vox
tacklePower = 4
anatomy_flags = HAS_SWEAT_GLANDS
survival_gear = /obj/item/weapon/storage/box/survival/vox
@@ -833,6 +839,8 @@ var/global/list/whitelisted_species = list("Human")
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/diona
attack_verb = "slashes"
punch_damage = 5
tacklePower = 7
tackleRange = 1
primitive = /mob/living/carbon/monkey/diona
spells = list(/spell/targeted/transfer_reagents)
@@ -887,6 +895,8 @@ var/global/list/whitelisted_species = list("Human")
known_languages = list(LANGUAGE_GOLEM)
meat_type = /obj/item/stack/ore/diamond
attack_verb = "punches"
tacklePower = 8
tackleRange = 1
flags = NO_BREATHE | NO_PAIN | HYPOTHERMIA_IMMUNE
anatomy_flags = HAS_LIPS | NO_SKIN | NO_BLOOD | IS_BULKY | NO_STRUCTURE
@@ -1065,6 +1075,7 @@ var/list/has_died_as_golem = list()
known_languages = list(LANGUAGE_SLIME)
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/slime
attack_verb = "glomps"
tacklePower = 4
flags = IS_WHITELISTED | NO_BREATHE | ELECTRIC_HEAL
anatomy_flags = NO_SKIN | NO_BLOOD | NO_BONES | NO_STRUCTURE | MULTICOLOR

View File

@@ -145,3 +145,12 @@
//Chance is multiplied by the returned value
/mob/living/proc/knockout_chance_modifier()
return 0
/mob/living/proc/calcTackleForce()
return 0
/mob/living/proc/calcTackleDefense()
return 0
/mob/living/proc/calcTackleRange()
return 0