Adds a 'nemesis faction' system to transforming weapons
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/obj/item/weapon/melee/transforming //TODO: make transforming energy weapons a subtype of this
|
||||
var/active = FALSE
|
||||
var/force_on = 30 //force when active
|
||||
var/faction_bonus_force = 0 //Bonus force dealt against certain factions
|
||||
var/throwforce_on = 20
|
||||
var/icon_state_on = "axe1"
|
||||
var/hitsound_on = 'sound/weapons/blade1.ogg'
|
||||
@@ -8,6 +9,8 @@
|
||||
var/list/attack_verb_off = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
sharpness = IS_SHARP
|
||||
var/bonus_active = FALSE //If the faction damage bonus is active
|
||||
var/list/nemesis_factions //Any mob with a faction that exists in this list will take bonus damage/effects
|
||||
var/w_class_on = WEIGHT_CLASS_BULKY
|
||||
|
||||
/obj/item/weapon/melee/transforming/Initialize()
|
||||
@@ -23,6 +26,19 @@
|
||||
if(transform_weapon(user))
|
||||
clumsy_transform_effect(user)
|
||||
|
||||
/obj/item/weapon/melee/transforming/attack(mob/living/target, mob/living/carbon/human/user)
|
||||
var/nemesis_faction = FALSE
|
||||
if(nemesis_factions.len)
|
||||
for(var/F in target.faction)
|
||||
if(F in nemesis_factions)
|
||||
nemesis_faction = TRUE
|
||||
force += faction_bonus_force
|
||||
nemesis_effects(user, target)
|
||||
break
|
||||
. = ..()
|
||||
if(nemesis_faction)
|
||||
force -= faction_bonus_force
|
||||
|
||||
/obj/item/weapon/melee/transforming/proc/transform_weapon(mob/living/user, supress_message_text)
|
||||
active = !active
|
||||
if(active)
|
||||
@@ -47,6 +63,9 @@
|
||||
add_fingerprint(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/weapon/melee/transforming/proc/nemesis_effects(mob/living/user, mob/living/target)
|
||||
return
|
||||
|
||||
/obj/item/weapon/melee/transforming/proc/transform_messages(mob/living/user, supress_message_text)
|
||||
playsound(user, active ? 'sound/weapons/saberon.ogg' : 'sound/weapons/saberoff.ogg', 35, 1) //changed it from 50% volume to 35% because deafness
|
||||
if(!supress_message_text)
|
||||
@@ -55,4 +74,4 @@
|
||||
/obj/item/weapon/melee/transforming/proc/clumsy_transform_effect(mob/living/user)
|
||||
if(user.disabilities & CLUMSY && prob(50))
|
||||
to_chat(user, "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>")
|
||||
user.take_bodypart_damage(5,5)
|
||||
user.take_bodypart_damage(5,5)
|
||||
|
||||
@@ -583,9 +583,10 @@
|
||||
hitsound_on = 'sound/weapons/bladeslice.ogg'
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
sharpness = IS_SHARP
|
||||
faction_bonus_force = 30
|
||||
nemesis_factions = list("mining", "boss")
|
||||
var/transform_cooldown
|
||||
var/swiping = FALSE
|
||||
var/beast_force_bonus = 30
|
||||
|
||||
/obj/item/weapon/melee/transforming/cleaving_saw/examine(mob/user)
|
||||
..()
|
||||
@@ -625,34 +626,27 @@
|
||||
if(!active)
|
||||
user.changeNext_move(CLICK_CD_MELEE * 0.5) //when closed, it attacks very rapidly
|
||||
|
||||
/obj/item/weapon/melee/transforming/cleaving_saw/nemesis_effects(mob/living/user, mob/living/target)
|
||||
var/datum/status_effect/saw_bleed/B = target.has_status_effect(STATUS_EFFECT_SAWBLEED)
|
||||
if(!B)
|
||||
if(!active) //This isn't in the above if-check so that the else doesn't care about active
|
||||
target.apply_status_effect(STATUS_EFFECT_SAWBLEED)
|
||||
else
|
||||
B.add_bleed(B.bleed_buildup)
|
||||
|
||||
/obj/item/weapon/melee/transforming/cleaving_saw/attack(mob/living/target, mob/living/carbon/human/user)
|
||||
if(!active || swiping || !target.density || get_turf(target) == get_turf(user))
|
||||
var/beast_bonus_active = FALSE
|
||||
var/datum/status_effect/saw_bleed/B = target.has_status_effect(STATUS_EFFECT_SAWBLEED)
|
||||
if(istype(target, /mob/living/simple_animal/hostile/asteroid) || ismegafauna(target))
|
||||
if(!active)
|
||||
if(!B)
|
||||
target.apply_status_effect(STATUS_EFFECT_SAWBLEED)
|
||||
else
|
||||
B.add_bleed(B.bleed_buildup)
|
||||
else
|
||||
force += beast_force_bonus //we do bonus damage against beastly creatures
|
||||
beast_bonus_active = TRUE
|
||||
if(!active || swiping)
|
||||
..()
|
||||
if(beast_bonus_active)
|
||||
if(B)
|
||||
B.add_bleed(B.bleed_buildup)
|
||||
force -= beast_force_bonus
|
||||
return
|
||||
var/turf/user_turf = get_turf(user)
|
||||
var/dir_to_target = get_dir(user_turf, get_turf(target))
|
||||
swiping = TRUE
|
||||
for(var/i in 1 to 3)
|
||||
var/turf/T = get_step(user_turf, turn(dir_to_target, 90 - (45 * i)))
|
||||
for(var/mob/living/L in T)
|
||||
if(user.Adjacent(L) && L.density)
|
||||
melee_attack_chain(user, L)
|
||||
swiping = FALSE
|
||||
else
|
||||
var/turf/user_turf = get_turf(user)
|
||||
var/dir_to_target = get_dir(user_turf, get_turf(target))
|
||||
swiping = TRUE
|
||||
for(var/i in 1 to 3)
|
||||
var/turf/T = get_step(user_turf, turn(dir_to_target, 90 - (45 * i)))
|
||||
for(var/mob/living/L in T)
|
||||
if(user.Adjacent(L) && L.density)
|
||||
melee_attack_chain(user, L)
|
||||
swiping = FALSE
|
||||
|
||||
//Dragon
|
||||
|
||||
|
||||
Reference in New Issue
Block a user