From 9cbc501511e2d80f0470e00e84ac3b7bea3fd360 Mon Sep 17 00:00:00 2001 From: "oskar.wiksten" Date: Sun, 29 Apr 2012 21:38:58 +0000 Subject: [PATCH] Renamed critical hit skills to "Internal bleeding" and "Fracture". Fixed bug where the monster attacks would not change state to completed if you enter inventory while the monsters are attacking (this also fixes one long outstanding bug with double monster attacks if you enter inventory). Updated list of authors. git-svn-id: https://andors-trail.googlecode.com/svn/trunk@237 08aca716-68be-ccc6-4d58-36f5abd142ac --- AndorsTrail/res/values/authors.xml | 3 +- .../res/values/content_actorconditions.xml | 4 +-- AndorsTrail/res/values/strings.xml | 12 ++++---- .../AndorsTrail/activity/MainActivity.java | 3 +- .../activity/SkillInfoActivity.java | 8 ++--- .../controller/CombatController.java | 30 +++++++++++-------- .../controller/SkillController.java | 12 ++++---- .../model/ability/SkillCollection.java | 16 +++++----- .../AndorsTrail/view/SkillListAdapter.java | 4 +-- 9 files changed, 49 insertions(+), 43 deletions(-) diff --git a/AndorsTrail/res/values/authors.xml b/AndorsTrail/res/values/authors.xml index f681ebc..3699ac5 100644 --- a/AndorsTrail/res/values/authors.xml +++ b/AndorsTrail/res/values/authors.xml @@ -34,7 +34,8 @@ Forum moderated by Tim Davis<br /> Forum moderated by Josh Kloos<br /> Forum moderated by Travis Miller<br /> - Forum moderated by Matthew B. White<br /> + Forum moderated by Matthew B. White (Nyktos)<br /> + Forum moderated by Pyrizzle<br /> <br /> <a href="http://rltiles.sourceforge.net">Monster tileset graphics by rltiles.sourceforge.net</a><br /> Part of (or All) the graphic tiles used in this program is the public domain roguelike tileset "RLTiles". diff --git a/AndorsTrail/res/values/content_actorconditions.xml b/AndorsTrail/res/values/content_actorconditions.xml index 26e11c6..4d701e8 100644 --- a/AndorsTrail/res/values/content_actorconditions.xml +++ b/AndorsTrail/res/values/content_actorconditions.xml @@ -44,8 +44,8 @@ {shadowbless_heal|Blessing of Shadow regeneration|actorconditions_1:35|0||1|1|1|1|||||||||||||||||||||}; {shadowbless_acc|Blessing of Shadow accuracy|actorconditions_1:98|0||||||||||||||1|||||30|||||||}; {shadowbless_guard|Shadow guardian blessing|actorconditions_1:91|0||||||||||||||1|30||||||||||1|}; -{attenuation|Attenuation|actorconditions_1:89|2|1|||||||||||||1||||||||||-50|-2|}; -{enervation|Enervation|actorconditions_1:89|2|1|||||||||||||1||||1|-50|||-3|-3|||}; +{crit1|Internal bleeding|actorconditions_1:89|2|1|||||||||||||1||||1|-50|||-3|-3|||}; +{crit2|Fracture|actorconditions_1:89|2|1|||||||||||||1||||||||||-50|-2|}; diff --git a/AndorsTrail/res/values/strings.xml b/AndorsTrail/res/values/strings.xml index 5de4153..2cb9752 100644 --- a/AndorsTrail/res/values/strings.xml +++ b/AndorsTrail/res/values/strings.xml @@ -489,11 +489,11 @@ Immune to critical hits Effective critical chance: - Enervation - Chance of internal bleeding - For every critical hit made, there is a %1$d %% chance that the hit will cause internal bleeding on the target, effectively causing the \'Enervation\' condition on the target. Enervation severely lowers offensive combat abilities, making the target less able to land successful attacks. - Attenuation - Chance of shattering bones - For every critical hit made, there is a %1$d %% chance that the hit will shatter some of the target\'s bones, effectively causing the \'Attenuation\' condition on the target. Attenuation severely lowers defensive combat abilities, making the target less able to defend itself in subsequent attacks. + Internal bleeding + Chance of internal bleeding + For every critical hit made, there is a %1$d %% chance that the hit will cause internal bleeding on the target, effectively causing the \'Internal bleeding\' condition on the target. Internal bleeding severely lowers offensive combat abilities, making the target less able to land successful attacks. + Fracture + Chance of bone fracture + For every critical hit made, there is a %1$d %% chance that the hit will fracture some of the target\'s bones, effectively causing the \'Fracture\' condition on the target. This will severely lower the target\'s defensive combat abilities, making the it less able to defend itself in subsequent attacks. diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/MainActivity.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/MainActivity.java index 6ac6eab..5e53ab7 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/MainActivity.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/MainActivity.java @@ -177,11 +177,12 @@ public final class MainActivity extends Activity { L.log("onResume"); if (!AndorsTrailApplication.getApplicationFromActivity(this).setup.isSceneReady) return; + view.gameRoundController.resume(); + if (world.model.uiSelections.isInCombat) { view.combatController.setCombatSelection(world.model.uiSelections.selectedMonster, world.model.uiSelections.selectedPosition); view.combatController.enterCombat(CombatController.BEGIN_TURN_CONTINUE); } - view.gameRoundController.resume(); } @Override diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/SkillInfoActivity.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/SkillInfoActivity.java index 0b44449..fd73726 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/SkillInfoActivity.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/SkillInfoActivity.java @@ -132,8 +132,8 @@ public final class SkillInfoActivity extends Activity { case SkillCollection.SKILL_RESISTANCE_PHYSICAL_CAPACITY: return R.string.skill_title_resistance_physical_capacity; case SkillCollection.SKILL_RESISTANCE_BLOOD_DISORDER: return R.string.skill_title_resistance_blood_disorder; case SkillCollection.SKILL_SHADOW_BLESS: return R.string.skill_title_shadow_bless; - case SkillCollection.SKILL_ENERVATION: return R.string.skill_title_enervation; - case SkillCollection.SKILL_ATTENUATION: return R.string.skill_title_attenuation; + case SkillCollection.SKILL_CRIT1: return R.string.skill_title_crit1; + case SkillCollection.SKILL_CRIT2: return R.string.skill_title_crit2; default: return -1; } @@ -162,8 +162,8 @@ public final class SkillInfoActivity extends Activity { case SkillCollection.SKILL_RESISTANCE_PHYSICAL_CAPACITY: return res.getString(R.string.skill_longdescription_resistance_physical_capacity, SkillCollection.PER_SKILLPOINT_INCREASE_RESISTANCE_CHANCE_PERCENT, SkillCollection.PER_SKILLPOINT_INCREASE_RESISTANCE_CHANCE_PERCENT * SkillCollection.MAX_LEVEL_RESISTANCE); case SkillCollection.SKILL_RESISTANCE_BLOOD_DISORDER: return res.getString(R.string.skill_longdescription_resistance_blood_disorder, SkillCollection.PER_SKILLPOINT_INCREASE_RESISTANCE_CHANCE_PERCENT, SkillCollection.PER_SKILLPOINT_INCREASE_RESISTANCE_CHANCE_PERCENT * SkillCollection.MAX_LEVEL_RESISTANCE); case SkillCollection.SKILL_SHADOW_BLESS: return res.getString(R.string.skill_longdescription_shadow_bless, SkillCollection.PER_SKILLPOINT_INCREASE_RESISTANCE_SHADOW_BLESS); - case SkillCollection.SKILL_ENERVATION: return res.getString(R.string.skill_longdescription_enervation, SkillCollection.PER_SKILLPOINT_INCREASE_ENERVATION); - case SkillCollection.SKILL_ATTENUATION: return res.getString(R.string.skill_longdescription_attenuation, SkillCollection.PER_SKILLPOINT_INCREASE_ATTENUATION); + case SkillCollection.SKILL_CRIT1: return res.getString(R.string.skill_longdescription_crit1, SkillCollection.PER_SKILLPOINT_INCREASE_CRIT1); + case SkillCollection.SKILL_CRIT2: return res.getString(R.string.skill_longdescription_crit2, SkillCollection.PER_SKILLPOINT_INCREASE_CRIT2); default: return ""; } diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/CombatController.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/CombatController.java index 1559e06..864383e 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/CombatController.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/CombatController.java @@ -56,7 +56,7 @@ public final class CombatController implements VisualEffectCompletedCallback { context.mainActivity.clearMessages(); if (beginTurnAs == BEGIN_TURN_PLAYER) newPlayerTurn(); else if (beginTurnAs == BEGIN_TURN_MONSTERS) endPlayerTurn(); - else maybeAutoEndTurn(); + else continueTurn(); updateTurnInfo(); } public void exitCombat(boolean pickupLootBags) { @@ -223,8 +223,7 @@ public final class CombatController implements VisualEffectCompletedCallback { } } - context.mainActivity.updateStatus(); - maybeAutoEndTurn(); + playerActionCompleted(); } public void playerKilledMonster(Monster killedMonster) { @@ -257,12 +256,18 @@ public final class CombatController implements VisualEffectCompletedCallback { context.mainActivity.redrawAll(MainView.REDRAW_ALL_MONSTER_KILLED); } - private void maybeAutoEndTurn() { - if (model.player.ap.current < model.player.useItemCost - && model.player.ap.current < model.player.combatTraits.attackCost - && model.player.ap.current < model.player.actorTraits.moveCost) { - endPlayerTurn(); - } + private boolean playerHasApLeft() { + if (model.player.ap.current >= model.player.useItemCost) return true; + if (model.player.ap.current >= model.player.combatTraits.attackCost) return true; + if (model.player.ap.current >= model.player.actorTraits.moveCost) return true; + return false; + } + private void playerActionCompleted() { + context.mainActivity.updateStatus(); + if (!playerHasApLeft()) endPlayerTurn(); + } + private void continueTurn() { + if (!playerHasApLeft()) handleNextMonsterAction(); } private void executeCombatMove(final Coord dest) { @@ -281,8 +286,7 @@ public final class CombatController implements VisualEffectCompletedCallback { if (canExitCombat()) exitCombat(true); - context.mainActivity.updateStatus(); - maybeAutoEndTurn(); + playerActionCompleted(); } private void fleeingFailed() { @@ -290,7 +294,7 @@ public final class CombatController implements VisualEffectCompletedCallback { message(r.getString(R.string.combat_flee_failed)); endPlayerTurn(); } - + private final Handler monsterTurnHandler = new Handler() { public void handleMessage(Message msg) { monsterTurnHandler.removeMessages(0); @@ -315,7 +319,7 @@ public final class CombatController implements VisualEffectCompletedCallback { //monsterTurnHandler.removeMessages(0); //monsterTurnHandler.sendEmptyMessage(0); } - + private Monster determineNextMonster(Monster previousMonster) { if (previousMonster != null) { if (previousMonster.useAPs(previousMonster.combatTraits.attackCost)) return previousMonster; diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/SkillController.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/SkillController.java index 4e1ff66..02aacf5 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/SkillController.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/SkillController.java @@ -111,19 +111,19 @@ public final class SkillController { } public static void applyCriticalHitSkillEffectsToMonster(WorldContext world, Player player, Monster monster) { - int skillLevel = player.getSkillLevel(SkillCollection.SKILL_ATTENUATION); + int skillLevel = player.getSkillLevel(SkillCollection.SKILL_CRIT2); if (skillLevel > 0) { - if (Constants.roll100(SkillCollection.PER_SKILLPOINT_INCREASE_ATTENUATION * skillLevel)) { - ActorConditionType conditionType = world.actorConditionsTypes.getActorConditionType("attenuation"); + if (Constants.roll100(SkillCollection.PER_SKILLPOINT_INCREASE_CRIT2 * skillLevel)) { + ActorConditionType conditionType = world.actorConditionsTypes.getActorConditionType("crit2"); ActorConditionEffect effect = new ActorConditionEffect(conditionType, 1, 5, null); ActorStatsController.applyActorCondition(monster, effect); } } - skillLevel = player.getSkillLevel(SkillCollection.SKILL_ENERVATION); + skillLevel = player.getSkillLevel(SkillCollection.SKILL_CRIT1); if (skillLevel > 0) { - if (Constants.roll100(SkillCollection.PER_SKILLPOINT_INCREASE_ENERVATION * skillLevel)) { - ActorConditionType conditionType = world.actorConditionsTypes.getActorConditionType("enervation"); + if (Constants.roll100(SkillCollection.PER_SKILLPOINT_INCREASE_CRIT1 * skillLevel)) { + ActorConditionType conditionType = world.actorConditionsTypes.getActorConditionType("crit1"); ActorConditionEffect effect = new ActorConditionEffect(conditionType, 1, 5, null); ActorStatsController.applyActorCondition(monster, effect); } diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/ability/SkillCollection.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/ability/SkillCollection.java index a834bf7..5a863f2 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/ability/SkillCollection.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/ability/SkillCollection.java @@ -32,10 +32,10 @@ public final class SkillCollection { public static final int SKILL_RESISTANCE_PHYSICAL_CAPACITY = 18; // lowers chance to get negative active conditions by monsters (Physical Capacity like Minor fatigue) public static final int SKILL_RESISTANCE_BLOOD_DISORDER = 19; // lowers chance to get negative active conditions by monsters (Blood Disorder like Weak Poison) public static final int SKILL_SHADOW_BLESS = 20; - public static final int SKILL_ENERVATION = 21; // lowers atk ability - public static final int SKILL_ATTENUATION = 22; // lowers def ability + public static final int SKILL_CRIT1 = 21; // lowers atk ability + public static final int SKILL_CRIT2 = 22; // lowers def ability - public static final int NUM_SKILLS = SKILL_ATTENUATION + 1; + public static final int NUM_SKILLS = SKILL_CRIT2 + 1; public static final int PER_SKILLPOINT_INCREASE_WEAPON_CHANCE = 12; public static final int PER_SKILLPOINT_INCREASE_WEAPON_DAMAGE_MAX = 1; @@ -59,8 +59,8 @@ public final class SkillCollection { public static final int PER_SKILLPOINT_INCREASE_EXPLOSS_PERCENT = 20; public static final int PER_SKILLPOINT_INCREASE_RESISTANCE_CHANCE_PERCENT = 10; public static final int PER_SKILLPOINT_INCREASE_RESISTANCE_SHADOW_BLESS = 5; - public static final int PER_SKILLPOINT_INCREASE_ENERVATION = 50; - public static final int PER_SKILLPOINT_INCREASE_ATTENUATION = 50; + public static final int PER_SKILLPOINT_INCREASE_CRIT1 = 50; + public static final int PER_SKILLPOINT_INCREASE_CRIT2 = 50; public static final int MAX_LEVEL_BARTER = (int) Math.floor((float) Constants.MARKET_PRICEFACTOR_PERCENT / PER_SKILLPOINT_INCREASE_BARTER_PRICEFACTOR_PERCENTAGE); public static final int MAX_LEVEL_BARKSKIN = 5; @@ -115,14 +115,14 @@ public final class SkillCollection { initializeSkill(new SkillInfo(SKILL_RESISTANCE_PHYSICAL_CAPACITY, MAX_LEVEL_RESISTANCE, false, null)); initializeSkill(new SkillInfo(SKILL_RESISTANCE_BLOOD_DISORDER, MAX_LEVEL_RESISTANCE, false, null)); initializeSkill(new SkillInfo(SKILL_SHADOW_BLESS, 1, true, null)); - initializeSkill(new SkillInfo(SKILL_ENERVATION, 1, false, new SkillLevelRequirement[] { + initializeSkill(new SkillInfo(SKILL_CRIT1, 1, false, new SkillLevelRequirement[] { SkillLevelRequirement.requireOtherSkill(SKILL_MORE_CRITICALS, 3) ,SkillLevelRequirement.requireOtherSkill(SKILL_BETTER_CRITICALS, 3) })); - initializeSkill(new SkillInfo(SKILL_ATTENUATION, 1, false, new SkillLevelRequirement[] { + initializeSkill(new SkillInfo(SKILL_CRIT2, 1, false, new SkillLevelRequirement[] { SkillLevelRequirement.requireOtherSkill(SKILL_MORE_CRITICALS, 6) ,SkillLevelRequirement.requireOtherSkill(SKILL_BETTER_CRITICALS, 6) - ,SkillLevelRequirement.requireOtherSkill(SKILL_ENERVATION, 1) + ,SkillLevelRequirement.requireOtherSkill(SKILL_CRIT1, 1) })); } diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/view/SkillListAdapter.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/view/SkillListAdapter.java index 449e5c3..fe592ff 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/view/SkillListAdapter.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/view/SkillListAdapter.java @@ -114,8 +114,8 @@ public final class SkillListAdapter extends ArrayAdapter { case SkillCollection.SKILL_RESISTANCE_PHYSICAL_CAPACITY: return R.string.skill_shortdescription_resistance_physical_capacity; case SkillCollection.SKILL_RESISTANCE_BLOOD_DISORDER: return R.string.skill_shortdescription_resistance_blood_disorder; case SkillCollection.SKILL_SHADOW_BLESS: return R.string.skill_shortdescription_shadow_bless; - case SkillCollection.SKILL_ENERVATION: return R.string.skill_shortdescription_enervation; - case SkillCollection.SKILL_ATTENUATION: return R.string.skill_shortdescription_attenuation; + case SkillCollection.SKILL_CRIT1: return R.string.skill_shortdescription_crit1; + case SkillCollection.SKILL_CRIT2: return R.string.skill_shortdescription_crit2; default: return -1; } -- 2.49.0