Exposes all embedding related multipliers as variables and definitions. Only items of throw_speed 4 or more can embed now, Explosions force their object to be thrown at 4, this throw_speed threshold is ON TOP of needing to be a can_embed() object.

This commit is contained in:
Remie Richards
2015-02-26 17:04:00 +00:00
parent f4c5332817
commit 1e8324c3c5
6 changed files with 46 additions and 21 deletions
+9 -3
View File
@@ -52,6 +52,12 @@
//Embedded objects
#define EMBEDDED_PAIN_CHANCE 15 //Chance for embedded objects to cause pain (damage user)
#define EMBEDDED_ITEM_FALLOUT 5 //Chance for embedded object to fall out (causing pain but removing the object)
#define EMBED_CHANCE 45 //Chance for an object to embed into somebody when thrown (if it's sharp)
#define EMBEDDED_PAIN_CHANCE 15 //Chance for embedded objects to cause pain (damage user)
#define EMBEDDED_ITEM_FALLOUT 5 //Chance for embedded object to fall out (causing pain but removing the object)
#define EMBED_CHANCE 45 //Chance for an object to embed into somebody when thrown (if it's sharp)
#define EMBEDDED_PAIN_MULTIPLIER 2 //Coefficient of multiplication for the damage the item does while embedded (this*item.w_class)
#define EMBEDDED_FALL_PAIN_MULTIPLIER 5 //Coefficient of multiplication for the damage the item does when it falls out (this*item.w_class)
#define EMBEDDED_IMPACT_PAIN_MULTIPLIER 4 //Coefficient of multiplication for the damage the item does when it first embeds (this*item.w_class)
#define EMBED_THROWSPEED_THRESHOLD 4 //The minimum value of an item's throw_speed for it to embed (Unless it has embedded_ignore_throwspeed_threshold set to 1)
#define EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER 8 //Coefficient of multiplication for the damage the item does when removed without a surgery (this*item.w_class)
#define EMBEDDED_UNSAFE_REMOVAL_TIME 30 //A Time in ticks, total removal time = (this*item.w_class)
+3 -1
View File
@@ -113,7 +113,9 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
spawn(0) //Simultaneously not one at a time
var/throw_range = rand(throw_dist, max_range)
var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range)
I.throw_at(throw_at, throw_range,1)
I.throw_speed = 4 //Temporarily change their throw_speed for embedding purposes (Reset when it finishes throwing, regardless of hitting anything)
I.throw_at(throw_at, throw_range, 2)//Throw it at 2 speed, this is purely visual anyway.
var/took = (world.timeofday-start)/10
//You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare
+20 -11
View File
@@ -48,9 +48,15 @@
var/hooded = 0
//So items can have custom embedd values
//Because customisation is king
var/embed_chance = EMBED_CHANCE
var/embedded_fall_chance = EMBEDDED_ITEM_FALLOUT
var/embedded_pain_chance = EMBEDDED_PAIN_CHANCE
var/embedded_pain_multiplier = EMBEDDED_PAIN_MULTIPLIER //The coefficient of multiplication for the damage this item does while embedded (this*w_class)
var/embedded_fall_pain_multiplier = EMBEDDED_FALL_PAIN_MULTIPLIER //The coefficient of multiplication for the damage this item does when falling out of a limb (this*w_class)
var/embedded_impact_pain_multiplier = EMBEDDED_IMPACT_PAIN_MULTIPLIER //The coefficient of multiplication for the damage this item does when first embedded (this*w_class)
var/embedded_unsafe_removal_pain_multiplier = EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER //The coefficient of multiplication for the damage removing this without surgery causes (this*w_class)
var/embedded_unsafe_removal_time = EMBEDDED_UNSAFE_REMOVAL_TIME //A time in ticks, multiplied by the w_class.
var/list/can_be_placed_into = list(
/obj/structure/table,
@@ -417,16 +423,19 @@
/obj/item/throw_impact(A)
if(istype(A, /mob/living/carbon/human))
var/mob/living/carbon/human/H = A
if(can_embed(src))
if(prob(embed_chance))
var/obj/item/organ/limb/L = pick(H.organs)
L.embedded_objects |= src
add_blood(H)//it embedded itself in you, of course it's bloody!
loc = H
L.take_damage(w_class*5)
H.visible_message("<span class='danger'>\the [name] embeds itself in [H]'s [L.getDisplayName()]!</span>","<span class='userdanger'>\the [name] embeds itself in your [L.getDisplayName()]!</span>")
return
if(throw_speed >= EMBED_THROWSPEED_THRESHOLD)
if(istype(A, /mob/living/carbon/human))
var/mob/living/carbon/human/H = A
if(can_embed(src))
if(prob(embed_chance))
var/obj/item/organ/limb/L = pick(H.organs)
L.embedded_objects |= src
add_blood(H)//it embedded itself in you, of course it's bloody!
loc = H
L.take_damage(w_class*embedded_impact_pain_multiplier)
H.visible_message("<span class='danger'>\the [name] embeds itself in [H]'s [L.getDisplayName()]!</span>","<span class='userdanger'>\the [name] embeds itself in your [L.getDisplayName()]!</span>")
return
//Reset regardless of if we hit a human.
throw_speed = initial(throw_speed) //explosions change this.
..()
+10 -2
View File
@@ -138,11 +138,15 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob, params)
icon_state = "throwingstar"
item_state = "eshield0"
force = 2
throwforce = 20
throwforce = 0 //This is never used since this has a 100% embed chance.
throw_speed = 4
embedded_pain_multiplier = 4
w_class = 2
embed_chance = 100
embedded_fall_chance = 0 //Hahaha!
//5*(2*4) = 5*8 = 45, 45 damage if you hit one person with all 5 stars.
//Not counting the damage it will do while embedded (2*4 = 8, at 15% chance)
/obj/item/weapon/storage/box/throwing_stars/New()
..()
contents = list()
@@ -150,4 +154,8 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob, params)
new /obj/item/weapon/throwing_star(src)
new /obj/item/weapon/throwing_star(src)
new /obj/item/weapon/throwing_star(src)
new /obj/item/weapon/throwing_star(src)
new /obj/item/weapon/throwing_star(src)
@@ -257,11 +257,11 @@
var/obj/item/organ/limb/L = locate(href_list["embedded_limb"])
if(!I || !L || I.loc != src) //no item, no limb, or item is not in limb (the person atleast) anymore
return
var/time_taken = 30*I.w_class
var/time_taken = I.embedded_unsafe_removal_time*I.w_class
usr.visible_message("<span class='notice'>[usr] attempts to remove [I] from their [L.getDisplayName()]!</span>","<span class='notice'>You attempt to remove [I] from your [L.getDisplayName()], it will take [time_taken/10] seconds.</span>")
if(do_after(usr, time_taken, needhand = 1))
L.embedded_objects -= I
L.take_damage(8*I.w_class)//It hurts to rip it out, get surgery you dingus.
L.take_damage(I.embedded_unsafe_removal_pain_multiplier*I.w_class)//It hurts to rip it out, get surgery you dingus.
I.loc = get_turf(src)
usr.put_in_hands(I)
usr.emote("scream")
+2 -2
View File
@@ -613,11 +613,11 @@
for(var/obj/item/organ/limb/L in organs)
for(var/obj/item/I in L.embedded_objects)
if(prob(I.embedded_pain_chance))
L.take_damage(I.w_class*2)
L.take_damage(I.w_class*I.embedded_pain_multiplier)
src << "<span class='userdanger'>\the [I] embedded in your [L.getDisplayName()] hurts!</span>"
if(prob(I.embedded_fall_chance))
L.take_damage(I.w_class*5)
L.take_damage(I.w_class*I.embedded_fall_pain_multiplier)
L.embedded_objects -= I
I.loc = get_turf(src)
visible_message("<span class='danger'>\the [I] falls out of [name]'s [L.getDisplayName()]!</span>","<span class='userdanger'>\the [I] falls out of your [L.getDisplayName()]!</span>")