Cargo. Event, Holder fixes (#1253)

Fixes runtime errors with cargo stock. Was caused by the type of armor boosts changing.

Probably fixes the issue of mobs dying when picked up. I added some robustness and safeties to it

Tweaks event probabilities, adjusting the major event distribution (rarer bears), raising some others and slightly reducing the overall chance of major events.
This commit is contained in:
NanakoAC
2016-12-21 21:39:22 +02:00
committed by skull132
parent 97bb1e8e38
commit d19c62c081
6 changed files with 82 additions and 17 deletions
+13 -4
View File
@@ -1351,11 +1351,19 @@ var/list/global/random_stock_large = list(
var/list/equips = list(
"/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp" = 1,
"/obj/item/mecha_parts/mecha_equipment/tool/drill" = 1,
"/obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill" = 0.7,
"/obj/item/mecha_parts/mecha_equipment/tool/extinguisher" = 1,
"/obj/item/mecha_parts/mecha_equipment/tool/rcd" = 0.08,
"/obj/item/mecha_parts/mecha_equipment/teleporter" = 0.3,
"/obj/item/mecha_parts/mecha_equipment/wormhole_generator" = 0.5,
"/obj/item/mecha_parts/mecha_equipment/gravcatapult" = 0.8,
"/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster" = 1,
"/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster" = 0.9,
"/obj/item/mecha_parts/mecha_equipment/armor_booster/anticcw_armor_booster" = 1,
"/obj/item/mecha_parts/mecha_equipment/armor_booster/antiproj_armor_booster" = 0.9,
"/obj/item/mecha_parts/mecha_equipment/repair_droid" = 0.7,
"/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay" = 0.4,
"/obj/item/mecha_parts/mecha_equipment/generator" = 1.5,
"/obj/item/mecha_parts/mecha_equipment/generator/nuclear" = 0.8,
"/obj/item/mecha_parts/mecha_equipment/tool/safety_clamp" = 0.2,
"/obj/item/mecha_parts/mecha_equipment/tool/passenger" = 1,
"/obj/item/mecha_parts/mecha_equipment/tool/sleeper" = 0.9,
"/obj/item/mecha_parts/mecha_equipment/tool/cable_layer" = 1.2,
@@ -1534,8 +1542,8 @@ var/list/global/random_stock_large = list(
"/obj/item/mecha_parts/mecha_equipment/teleporter" = 0.3,
"/obj/item/mecha_parts/mecha_equipment/wormhole_generator" = 0.5,
"/obj/item/mecha_parts/mecha_equipment/gravcatapult" = 0.8,
"/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster" = 1,
"/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster" = 0.9,
"/obj/item/mecha_parts/mecha_equipment/armor_booster/anticcw_armor_booster" = 1,
"/obj/item/mecha_parts/mecha_equipment/armor_booster/antiproj_armor_booster" = 0.9,
"/obj/item/mecha_parts/mecha_equipment/repair_droid" = 0.7,
"/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay" = 0.4,
"/obj/item/mecha_parts/mecha_equipment/generator" = 1.5,
@@ -1547,6 +1555,7 @@ var/list/global/random_stock_large = list(
"/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun" = 1
)
var/number = rand(2,5)
while (number > 0)
var/type = pickweight(equips)
+5 -5
View File
@@ -142,7 +142,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Trivial News", /datum/event/trivial_news, 400),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation",/datum/event/infestation, 60, list(ASSIGNMENT_JANITOR = 20, ASSIGNMENT_SECURITY = 10)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 75, list(ASSIGNMENT_ENGINEER = 5, ASSIGNMENT_GARDENER = 20)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Clogged Vents", /datum/event/vent_clog, 85),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Clogged Vents", /datum/event/vent_clog, 70),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "False Alarm", /datum/event/false_alarm, 100),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Supply Drop", /datum/event/supply_drop, 80),
@@ -173,13 +173,13 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
/datum/event_container/major
severity = EVENT_LEVEL_MAJOR
available_events = list(
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 90),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 105),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 50, list(ASSIGNMENT_ENGINEER = 5,ASSIGNMENT_SECURITY = 5), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, 60, list(ASSIGNMENT_SECURITY = 10), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 40, list(ASSIGNMENT_ENGINEER = 10),1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Space Vines", /datum/event/spacevine, 60, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_GARDENER = 20), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 20, list(ASSIGNMENT_MEDICAL = 13), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Bluespace Bears", /datum/event/bear_attack, 50, list(ASSIGNMENT_SECURITY = 10), 1)
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Space Vines", /datum/event/spacevine, 75, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_GARDENER = 20), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 20, list(ASSIGNMENT_MEDICAL = 15), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Bluespace Bears", /datum/event/bear_attack, 35, list(ASSIGNMENT_SECURITY = 10), 1)
)
//NOTE: Re added nothing option, but with fairly low weight
+27 -8
View File
@@ -28,6 +28,8 @@ var/list/holder_mob_icon_cache = list()
/obj/item/weapon/holder/Destroy()
processing_objects.Remove(src)
if (contained)
release_mob()
..()
/obj/item/weapon/holder/examine(mob/user)
@@ -120,6 +122,7 @@ var/list/holder_mob_icon_cache = list()
M.reset_view()
M.Released()
contained = null
var/mob/L = get_holding_mob()
if (L)
L.drop_from_inventory(src)
@@ -241,15 +244,31 @@ var/list/holder_mob_icon_cache = list()
else
H.isalive = 1//We note that the mob is alive when picked up. If it dies later, we can know that its death happened while held, and play its deathmessage for it
if (user == src)
grabber << "<span class='notice'>[src.name] climbs up onto you.</span>"
src << "<span class='notice'>You climb up onto [grabber].</span>"
var/success = 0
if (src == user)
success = grabber.put_in_any_hand_if_possible(H, 0,1,1)
else
grabber << "<span class='notice'>You scoop up [src].</span>"
src << "<span class='notice'>[grabber] scoops you up.</span>"
grabber.status_flags |= PASSEMOTES
H.attack_hand(grabber)//We put this last to prevent some race conditions
return
H.attack_hand(grabber)//We put this last to prevent some race conditions
if (H.loc == grabber)
success = 1
if (success)
if (user == src)
grabber << "<span class='notice'>[src.name] climbs up onto you.</span>"
src << "<span class='notice'>You climb up onto [grabber].</span>"
else
grabber << "<span class='notice'>You scoop up [src].</span>"
src << "<span class='notice'>[grabber] scoops you up.</span>"
else
user << "Failed, try again!"
//If the scooping up failed something must have gone wrong
H.release_mob()
return success
/mob/living/proc/get_holder_location()