Merge pull request #5705 from Citadel-Station-13/upstream-merge-35744

[MIRROR] Refactors butchering to a component - item-based butchering effectiveness, speed, and chances
This commit is contained in:
deathride58
2018-02-25 21:41:38 +00:00
committed by GitHub
29 changed files with 207 additions and 30 deletions

View File

@@ -789,8 +789,6 @@
if(organs_amt)
to_chat(user, "<span class='notice'>You retrieve some of [src]\'s internal organs!</span>")
..()
/mob/living/carbon/ExtinguishMob()
for(var/X in get_equipped_items())
var/obj/item/I = X

View File

@@ -162,7 +162,7 @@
//Weapon
/obj/item/light_eater
name = "light eater"
name = "light eater" //as opposed to heavy eater
icon_state = "arm_blade"
item_state = "arm_blade"
force = 25
@@ -173,6 +173,10 @@
w_class = WEIGHT_CLASS_HUGE
sharpness = IS_SHARP
/obj/item/light_eater/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 80, 70)
/obj/item/light_eater/afterattack(atom/movable/AM, mob/user, proximity)
if(!proximity)
return

View File

@@ -773,17 +773,8 @@
/mob/living/proc/get_permeability_protection()
return 0
/mob/living/proc/harvest(mob/living/user)
if(QDELETED(src))
return
if(butcher_results)
var/atom/Tsec = drop_location()
for(var/path in butcher_results)
for(var/i = 1; i <= butcher_results[path];i++)
new path(Tsec)
butcher_results.Remove(path) //In case you want to have things like simple_animals drop their butcher results on gib, so it won't double up below.
visible_message("<span class='notice'>[user] butchers [src].</span>")
gib(0, 0, 1)
/mob/living/proc/harvest(mob/living/user) //used for extra objects etc. in butchering
return
/mob/living/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE)
if(incapacitated())

View File

@@ -65,7 +65,10 @@
var/last_bumped = 0
var/unique_name = 0 //if a mob's name should be appended with an id when created e.g. Mob (666)
var/list/butcher_results = null
var/list/butcher_results = null //these will be yielded from butchering with a probability chance equal to the butcher item's effectiveness
var/list/guaranteed_butcher_results = null //these will always be yielded from butchering
var/butcher_difficulty = 0 //effectiveness prob. is modified negatively by this amount; positive numbers make it more difficult, negative ones make it easier
var/hellbound = 0 //People who've signed infernal contracts are unrevivable.
var/list/weather_immunities = list()

View File

@@ -53,7 +53,8 @@ Difficulty: Medium
pixel_x = -16
crusher_loot = list(/obj/structure/closet/crate/necropolis/dragon/crusher)
loot = list(/obj/structure/closet/crate/necropolis/dragon)
butcher_results = list(/obj/item/stack/ore/diamond = 5, /obj/item/stack/sheet/sinew = 5, /obj/item/stack/sheet/animalhide/ashdrake = 10, /obj/item/stack/sheet/bone = 30)
butcher_results = list(/obj/item/stack/ore/diamond = 5, /obj/item/stack/sheet/sinew = 5, /obj/item/stack/sheet/bone = 30)
guaranteed_butcher_results = list(/obj/item/stack/sheet/animalhide/ashdrake = 10)
var/swooping = NONE
var/swoop_cooldown = 0
medal_type = BOSS_MEDAL_DRAKE

View File

@@ -86,7 +86,8 @@
throw_message = "does nothing to the tough hide of the"
pre_attack_icon = "goliath2"
crusher_loot = /obj/item/crusher_trophy/goliath_tentacle
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/goliath = 2, /obj/item/stack/sheet/animalhide/goliath_hide = 1, /obj/item/stack/sheet/bone = 2)
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/goliath = 2, /obj/item/stack/sheet/bone = 2)
guaranteed_butcher_results = list(/obj/item/stack/sheet/animalhide/goliath_hide = 1)
loot = list()
stat_attack = UNCONSCIOUS
robust_searching = 1
@@ -111,6 +112,7 @@
throw_message = "does nothing to the rocky hide of the"
loot = list(/obj/item/stack/sheet/animalhide/goliath_hide) //A throwback to the asteroid days
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/goliath = 2, /obj/item/stack/sheet/bone = 2)
guaranteed_butcher_results = list()
crusher_drop_mod = 30
wander = FALSE
var/list/cached_tentacle_turfs

View File

@@ -63,7 +63,7 @@
. = ..()
/mob/living/simple_animal/hostile/mushroom/CanAttack(atom/the_target) // Mushroom-specific version of CanAttack to handle stupid attack_same = 2 crap so we don't have to do it for literally every single simple_animal/hostile because this shit never gets spawned
if(!the_target || isturf(the_target) || istype(the_target, /atom/movable/lighting_object))
if(!the_target || isturf(the_target) || istype(the_target, /atom/movable/lighting_object))
return FALSE
if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it
@@ -188,4 +188,3 @@
S.reagents.add_reagent("mushroomhallucinogen", powerlevel)
S.reagents.add_reagent("omnizine", powerlevel)
S.reagents.add_reagent("synaptizine", powerlevel)
qdel(src)