From 35a3b0c152b7bc7a1e211a9493a51ba9ec2ee7ba Mon Sep 17 00:00:00 2001 From: CIB123 Date: Tue, 18 Sep 2012 21:33:54 +0000 Subject: [PATCH] Added config options for toggling limbs breaking and bones breaking. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4721 316c924e-a436-60f5-8080-3fe189b3f50e --- code/controllers/configuration.dm | 7 +++++++ code/datums/organs/organ_external.dm | 11 ++++++----- config/game_options.txt | 7 +++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 48d4f22934f..4a33c74d95c 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -74,6 +74,9 @@ var/organ_health_multiplier = 1 var/organ_regeneration_multiplier = 1 + var/bones_can_break = 1 + var/limbs_can_break = 1 + var/revival_pod_plants = 1 var/revival_cloning = 1 var/revival_brain_life = -1 @@ -372,6 +375,10 @@ config.organ_health_multiplier = value / 100 if("organ_regeneration_multiplier") config.organ_regeneration_multiplier = value / 100 + if("bones_can_break") + config.bones_can_break = value + if("limbs_can_break") + config.limbs_can_break = value else diary << "Unknown setting in configuration: '[name]'" diff --git a/code/datums/organs/organ_external.dm b/code/datums/organs/organ_external.dm index 9d8dc5c45ce..48bc49aaa68 100644 --- a/code/datums/organs/organ_external.dm +++ b/code/datums/organs/organ_external.dm @@ -48,7 +48,7 @@ if(sharp) var/nux = brute * rand(10,15) - if(brute_dam >= max_damage * config.organ_health_multiplier) + if(config.limbs_can_break && brute_dam >= max_damage * config.organ_health_multiplier) if(prob(5 * brute)) status |= ORGAN_DESTROYED droplimb() @@ -59,7 +59,8 @@ if(!(status & ORGAN_ROBOT)) owner << "You feel something wet on your [display_name]" - if((brute_dam + burn_dam + brute + burn) < max_damage) + // If the limbs can break, make sure we don't exceed the maximum damage a limb can take before breaking + if((brute_dam + burn_dam + brute + burn) < max_damage || !config.limbs_can_break) if(brute) brute_dam += brute if( (prob(brute*2) && !sharp) || sharp ) @@ -70,7 +71,7 @@ burn_dam += burn createwound( BURN, burn ) else - var/can_inflict = max_damage - (brute_dam + burn_dam) //How much damage can we actually cause? + var/can_inflict = max_damage * config.organ_health_multiplier - (brute_dam + burn_dam) //How much damage can we actually cause? if(can_inflict) if (brute > 0 && burn > 0) brute = can_inflict/2 @@ -199,7 +200,7 @@ if(owner.life_tick % 4 == 0) update_wounds() if(status & ORGAN_DESTROYED) - if(!destspawn) + if(!destspawn && config.limbs_can_break) droplimb() return if(!(status & ORGAN_BROKEN)) @@ -209,7 +210,7 @@ status |= ORGAN_DESTROYED owner:update_body() return - if(brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) + if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) if(!(status & ORGAN_BROKEN)) owner.visible_message("\red You hear a loud cracking sound coming from \the [owner].","\red Something feels like it shattered in your [display_name]!","You hear a sickening crack.") owner.emote("scream") diff --git a/config/game_options.txt b/config/game_options.txt index 9eef19a5c8e..55bb346aca0 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -6,6 +6,13 @@ HEALTH_THRESHOLD_CRIT 0 ## level of health at which a mob becomes dead HEALTH_THRESHOLD_DEAD -100 +## Determines whether bones can be broken through excessive damage to the organ +## 0 means bones can't break, 1 means they can +BONES_CAN_BREAK 0 +## Determines whether limbs can be amputated through excessive damage to the organ +## 0 means limbs can't be amputated, 1 means they can +LIMBS_CAN_BREAK 0 + ## multiplier which enables organs to take more damage before bones breaking or limbs being destroyed ## 100 means normal, 50 means half ORGAN_HEALTH_MULTIPLIER 100