mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
Merge branch 'master' into stoutford_tests
Conflicts: AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/tiles/TileManager.java
This commit is contained in:
8
AndorsTrail/res/anim/hidemonsterconditionbar.xml
Normal file
8
AndorsTrail/res/anim/hidemonsterconditionbar.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/accelerate_interpolator"
|
||||
android:fromYDelta="0%"
|
||||
android:toYDelta="-100%"
|
||||
android:duration="300"
|
||||
/>
|
||||
8
AndorsTrail/res/anim/hidemonsterconditionbutton.xml
Normal file
8
AndorsTrail/res/anim/hidemonsterconditionbutton.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/accelerate_interpolator"
|
||||
android:fromXDelta="0%"
|
||||
android:toXDelta="100%"
|
||||
android:duration="300"
|
||||
/>
|
||||
9
AndorsTrail/res/anim/showmonsterconditionbar.xml
Normal file
9
AndorsTrail/res/anim/showmonsterconditionbar.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:fromYDelta="-100%"
|
||||
android:toYDelta="0%"
|
||||
android:duration="300"
|
||||
/>
|
||||
|
||||
9
AndorsTrail/res/anim/showmonsterconditionbutton.xml
Normal file
9
AndorsTrail/res/anim/showmonsterconditionbutton.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:fromXDelta="100%"
|
||||
android:toXDelta="0%"
|
||||
android:duration="300"
|
||||
/>
|
||||
|
||||
@@ -1,93 +1,130 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
>
|
||||
<LinearLayout
|
||||
android:id="@+id/combatview_actionbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal" >
|
||||
|
||||
<Button android:id="@+id/combatview_moveattack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:textSize="@dimen/actionbar_text"
|
||||
android:text="@string/combat_attack"
|
||||
/>
|
||||
<RelativeLayout
|
||||
android:id="@+id/combatview_fixedarea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView android:id="@+id/combatview_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/actionbar_text"
|
||||
android:layout_weight="1"
|
||||
android:shadowDx="1"
|
||||
android:shadowDy="1"
|
||||
android:shadowRadius="1"
|
||||
android:shadowColor="#000"
|
||||
android:paddingBottom="4sp"
|
||||
android:text="@string/status_ap"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:id="@+id/combatview_actionbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<Button android:id="@+id/combatview_endturn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:textSize="@dimen/actionbar_text"
|
||||
android:text="@string/combat_endturn"
|
||||
/>
|
||||
<Button
|
||||
android:id="@+id/combatview_moveattack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:text="@string/combat_attack"
|
||||
android:textSize="@dimen/actionbar_text" />
|
||||
|
||||
<Button android:id="@+id/combatview_flee"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:textSize="@dimen/actionbar_text"
|
||||
android:text="@string/combat_flee"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/combatview_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingBottom="4sp"
|
||||
android:shadowColor="#000"
|
||||
android:shadowDx="1"
|
||||
android:shadowDy="1"
|
||||
android:shadowRadius="1"
|
||||
android:text="@string/status_ap"
|
||||
android:textSize="@dimen/actionbar_text" />
|
||||
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/combatview_endturn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:text="@string/combat_endturn"
|
||||
android:textSize="@dimen/actionbar_text" />
|
||||
|
||||
<TextView android:id="@+id/combatview_monsterismoving"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/actionbar_text"
|
||||
android:layout_alignBottom="@id/combatview_actionbar"
|
||||
android:shadowDx="1"
|
||||
android:shadowDy="1"
|
||||
android:shadowRadius="1"
|
||||
android:shadowColor="#000"
|
||||
android:paddingBottom="4sp"
|
||||
android:text="@string/combat_monsteraction"
|
||||
android:gravity="center"
|
||||
/>
|
||||
<Button
|
||||
android:id="@+id/combatview_flee"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:text="@string/combat_flee"
|
||||
android:textSize="@dimen/actionbar_text" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/combatview_monsterbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_below="@id/combatview_actionbar"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/combatview_monsterismoving"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/combatview_actionbar"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="4sp"
|
||||
android:shadowColor="#000"
|
||||
android:shadowDx="1"
|
||||
android:shadowDy="1"
|
||||
android:shadowRadius="1"
|
||||
android:text="@string/combat_monsteraction"
|
||||
android:textSize="@dimen/actionbar_text" />
|
||||
|
||||
<ImageButton android:id="@+id/combatview_monsterinfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:layout_marginRight="5sp"
|
||||
android:contentDescription="@string/dialog_monsterencounter_info"
|
||||
/>
|
||||
<RelativeLayout
|
||||
android:id="@+id/combatview_monsterbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/combatview_actionbar"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<!-- android:animateLayoutChanges="true" -->
|
||||
|
||||
<com.gpl.rpg.AndorsTrail.view.RangeBar
|
||||
android:id="@+id/combatview_monsterhealth"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
<ImageButton
|
||||
android:id="@+id/combatview_monsterinfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="0sp"
|
||||
android:contentDescription="@string/dialog_monsterencounter_info"
|
||||
android:padding="8dp"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
</LinearLayout>
|
||||
<ImageButton
|
||||
android:id="@+id/combatview_monsterconditions_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="0sp"
|
||||
android:contentDescription="@string/dialog_monsterencounter_conditions"
|
||||
android:padding="8dp"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
<com.gpl.rpg.AndorsTrail.view.RangeBar
|
||||
android:id="@+id/combatview_monsterhealth"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/combatview_monsterconditions_button"
|
||||
android:layout_toRightOf="@id/combatview_monsterinfo" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/combatview_activeconditions_cliparea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/combatview_fixedarea"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="right" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/combatview_activeconditions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</merge>
|
||||
@@ -9,6 +9,26 @@
|
||||
"increaseDamageResistance": -1
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "chaotic_test",
|
||||
"iconID": "actorconditions_1:95",
|
||||
"name": "Chaotic test",
|
||||
"category": "mental",
|
||||
"abilityEffect": {
|
||||
"increaseBlockChance": -10,
|
||||
"increaseDamageResistance": -1
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "chaotic_test2",
|
||||
"iconID": "actorconditions_1:94",
|
||||
"name": "Chaotic test2",
|
||||
"category": "mental",
|
||||
"abilityEffect": {
|
||||
"increaseBlockChance": -10,
|
||||
"increaseDamageResistance": -1
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "chaotic_curse",
|
||||
"iconID": "actorconditions_1:89",
|
||||
|
||||
@@ -533,12 +533,14 @@
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"shortcut_lodar",
|
||||
"value":10
|
||||
"value":10,
|
||||
"negate":true
|
||||
},
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"shortcut_lodar",
|
||||
"value":30
|
||||
"value":30,
|
||||
"negate":true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -559,7 +561,8 @@
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"shortcut_lodar",
|
||||
"value":30
|
||||
"value":30,
|
||||
"negate":true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -575,12 +578,14 @@
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"shortcut_lodar",
|
||||
"value":10
|
||||
"value":10,
|
||||
"negate":true
|
||||
},
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"shortcut_lodar",
|
||||
"value":30
|
||||
"value":30,
|
||||
"negate":true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -596,7 +601,8 @@
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"shortcut_lodar",
|
||||
"value":50
|
||||
"value":50,
|
||||
"negate":true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -143,7 +143,8 @@
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"pathway_fallhaven",
|
||||
"value":40
|
||||
"value":40,
|
||||
"negate":true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"lodar2",
|
||||
"value":50
|
||||
"value":50,
|
||||
"negate":true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -22,7 +23,8 @@
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"shortcut_lodar",
|
||||
"value":22
|
||||
"value":22,
|
||||
"negate":true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -56,7 +58,8 @@
|
||||
{
|
||||
"requireType":"questProgress",
|
||||
"requireID":"shortcut_lodar",
|
||||
"value":40
|
||||
"value":40,
|
||||
"negate":true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"nextPhraseID":"vilegard_shop_notrust"
|
||||
"nextPhraseID":"vilegard_shop_notrust_smith"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -105,6 +105,20 @@
|
||||
{
|
||||
"id":"vilegard_shop_notrust",
|
||||
"message":"You are an outsider. We don't like outsiders here in Vilegard. Please leave.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"Why is everyone in Vilegard so suspicious of outsiders?",
|
||||
"nextPhraseID":"vilegard_shop_notrust_2"
|
||||
},
|
||||
{
|
||||
"text":"Can I see what items you have for sale?",
|
||||
"nextPhraseID":"vilegard_shop_notrust_2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id":"vilegard_shop_notrust_smith",
|
||||
"message":"You are an outsider. We don't like outsiders here in Vilegard. Please leave.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"Why is everyone in Vilegard so suspicious of outsiders?",
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
"addedConditions":[
|
||||
{
|
||||
"condition":"chaotic_grip",
|
||||
"magnitude": 1
|
||||
"magnitude": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -171,7 +171,17 @@
|
||||
"max": 1
|
||||
}
|
||||
},
|
||||
"hitReceivedEffect" : {
|
||||
"hitEffect":{
|
||||
"conditionsTarget":[
|
||||
{
|
||||
"condition":"chaotic_test",
|
||||
"magnitude":5,
|
||||
"duration":2,
|
||||
"chance":"100"
|
||||
}
|
||||
]
|
||||
},
|
||||
"hitReceivedEffect" : {
|
||||
"increaseCurrentHP": {
|
||||
"min": 1,
|
||||
"max": 1
|
||||
@@ -191,7 +201,7 @@
|
||||
"conditionsSource":[
|
||||
{
|
||||
"condition":"chaotic_grip",
|
||||
"magnitude": 1,
|
||||
"magnitude": 2,
|
||||
"duration": 5,
|
||||
"chance":"50"
|
||||
}
|
||||
@@ -199,9 +209,15 @@
|
||||
"conditionsTarget":[
|
||||
{
|
||||
"condition":"chaotic_grip",
|
||||
"magnitude": 1,
|
||||
"magnitude": 2,
|
||||
"duration": 5,
|
||||
"chance":"80"
|
||||
},
|
||||
{
|
||||
"condition":"chaotic_test2",
|
||||
"magnitude":3,
|
||||
"duration":4,
|
||||
"chance":"50"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"attackChance": 50,
|
||||
"droplistID": "debugshop1",
|
||||
"phraseID": "debugshop",
|
||||
"movementAggressionType":"wholeMap",
|
||||
"attackDamage": {
|
||||
"min": 1,
|
||||
"max": 2
|
||||
@@ -85,6 +86,7 @@
|
||||
"attackCost": 10,
|
||||
"attackChance": 50,
|
||||
"droplistID": "debuglist1",
|
||||
"movementAggressionType":"wholeMap",
|
||||
"attackDamage": {
|
||||
"min": 1,
|
||||
"max": 2
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<string name="dialog_monsterencounter_title">Encounter</string>
|
||||
<string name="dialog_monsterencounter_message">Do you want to attack?\nDifficulty: %1$s</string>
|
||||
<string name="dialog_monsterencounter_info">Info</string>
|
||||
<string name="dialog_monsterencounter_conditions">Conditions</string>
|
||||
|
||||
<string name="status_hp">HP:</string>
|
||||
<string name="status_ap">AP:</string>
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Locale;
|
||||
|
||||
public final class AndorsTrailApplication extends Application {
|
||||
|
||||
public static final boolean DEVELOPMENT_DEBUGRESOURCES = true;
|
||||
public static final boolean DEVELOPMENT_DEBUGRESOURCES = false;
|
||||
public static final boolean DEVELOPMENT_FORCE_STARTNEWGAME = false;
|
||||
public static final boolean DEVELOPMENT_FORCE_CONTINUEGAME = false;
|
||||
public static final boolean DEVELOPMENT_DEBUGBUTTONS = true;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Collection;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.*;
|
||||
import android.view.ContextMenu.ContextMenuInfo;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.View.OnLongClickListener;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -33,18 +33,22 @@ import com.gpl.rpg.AndorsTrail.model.ability.ActorCondition;
|
||||
import com.gpl.rpg.AndorsTrail.model.ability.ActorConditionEffect;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Monster;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Player;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemContainer.ItemEntry;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.Loot;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.MapObject;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.PredefinedMap;
|
||||
import com.gpl.rpg.AndorsTrail.resource.tiles.TileCollection;
|
||||
import com.gpl.rpg.AndorsTrail.savegames.Savegames;
|
||||
import com.gpl.rpg.AndorsTrail.util.Coord;
|
||||
import com.gpl.rpg.AndorsTrail.view.*;
|
||||
import com.gpl.rpg.AndorsTrail.view.QuickButton.QuickButtonContextMenuInfo;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Collection;
|
||||
import com.gpl.rpg.AndorsTrail.view.CombatView;
|
||||
import com.gpl.rpg.AndorsTrail.view.DisplayActiveActorConditionIcons;
|
||||
import com.gpl.rpg.AndorsTrail.view.ItemContainerAdapter;
|
||||
import com.gpl.rpg.AndorsTrail.view.MainView;
|
||||
import com.gpl.rpg.AndorsTrail.view.QuickButton;
|
||||
import com.gpl.rpg.AndorsTrail.view.QuickitemView;
|
||||
import com.gpl.rpg.AndorsTrail.view.QuickslotsItemContainerAdapter;
|
||||
import com.gpl.rpg.AndorsTrail.view.StatusView;
|
||||
import com.gpl.rpg.AndorsTrail.view.ToolboxView;
|
||||
import com.gpl.rpg.AndorsTrail.view.VirtualDpadView;
|
||||
|
||||
public final class MainActivity
|
||||
extends Activity
|
||||
@@ -90,6 +94,7 @@ public final class MainActivity
|
||||
combatview = (CombatView) findViewById(R.id.main_combatview);
|
||||
quickitemview = (QuickitemView) findViewById(R.id.main_quickitemview);
|
||||
activeConditions = new DisplayActiveActorConditionIcons(controllers, world, this, (RelativeLayout) findViewById(R.id.statusview_activeconditions));
|
||||
activeConditions.setTarget(world.model.player);
|
||||
VirtualDpadView dpad = (VirtualDpadView) findViewById(R.id.main_virtual_dpad);
|
||||
toolboxview = (ToolboxView) findViewById(R.id.main_toolboxview);
|
||||
statusview.registerToolboxViews(toolboxview, quickitemview);
|
||||
|
||||
@@ -365,7 +365,7 @@ public final class ActorStatsController {
|
||||
return;
|
||||
}
|
||||
|
||||
decreaseDurationAndRemoveConditions(monster);
|
||||
if (!isFullRound) decreaseDurationAndRemoveConditions(monster);
|
||||
}
|
||||
|
||||
private void applyStatsEffects(Actor actor, boolean isFullRound) {
|
||||
|
||||
@@ -94,6 +94,9 @@ public final class ConversationController {
|
||||
case alignmentChange:
|
||||
addAlignmentReward(player, effect.effectID, effect.value);
|
||||
break;
|
||||
case alignmentSet:
|
||||
setAlignmentReward(player, effect.effectID, effect.value);
|
||||
break;
|
||||
case giveItem:
|
||||
addItemReward(effect.effectID, effect.value, result);
|
||||
break;
|
||||
@@ -174,6 +177,11 @@ public final class ConversationController {
|
||||
MovementController.refreshMonsterAggressiveness(world.model.currentMap, world.model.player);
|
||||
}
|
||||
|
||||
private void setAlignmentReward(Player player, String faction, int delta) {
|
||||
player.setAlignment(faction, delta);
|
||||
MovementController.refreshMonsterAggressiveness(world.model.currentMap, world.model.player);
|
||||
}
|
||||
|
||||
private void addQuestProgressReward(Player player, String questID, int questProgress, ScriptEffectResult result) {
|
||||
QuestProgress progress = new QuestProgress(questID, questProgress);
|
||||
boolean added = player.addQuestProgress(progress);
|
||||
@@ -295,6 +303,7 @@ public final class ConversationController {
|
||||
break;
|
||||
case factionScore:
|
||||
result = player.getAlignment(requirement.requireID) >= requirement.value;
|
||||
break;
|
||||
default:
|
||||
result = true;
|
||||
}
|
||||
|
||||
@@ -76,15 +76,7 @@ public final class MonsterMovementController implements EvaluateWalkable {
|
||||
PredefinedMap map = world.model.currentMap;
|
||||
LayeredTileMap tileMap = world.model.currentTileMap;
|
||||
m.nextActionTime = System.currentTimeMillis() + getMillisecondsPerMove(m);
|
||||
if (m.movementDestination == null) {
|
||||
// Monster has waited and should start to move again.
|
||||
m.movementDestination = new Coord(m.position);
|
||||
if (Constants.rnd.nextBoolean()) {
|
||||
m.movementDestination.x = area.area.topLeft.x + Constants.rnd.nextInt(area.area.size.width);
|
||||
} else {
|
||||
m.movementDestination.y = area.area.topLeft.y + Constants.rnd.nextInt(area.area.size.height);
|
||||
}
|
||||
} else if (m.position.equals(m.movementDestination)) {
|
||||
if (m.movementDestination != null && m.position.equals(m.movementDestination)) {
|
||||
// Monster has been moving and arrived at the destination.
|
||||
cancelCurrentMonsterMovement(m);
|
||||
} else {
|
||||
@@ -108,7 +100,7 @@ public final class MonsterMovementController implements EvaluateWalkable {
|
||||
}
|
||||
|
||||
private void determineMonsterNextPosition(Monster m, MonsterSpawnArea area, Coord playerPosition) {
|
||||
if (m.isAgressive()) {
|
||||
// if (m.isAgressive()) {
|
||||
boolean searchForPath = false;
|
||||
if (m.getMovementAggressionType() == MonsterType.AggressionType.protectSpawn) {
|
||||
if (area.area.contains(playerPosition)) searchForPath = true;
|
||||
@@ -118,8 +110,18 @@ public final class MonsterMovementController implements EvaluateWalkable {
|
||||
if (searchForPath) {
|
||||
if (findPathFor(m, playerPosition)) return;
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
// Monster has waited and should start to move again.
|
||||
if (m.movementDestination == null) {
|
||||
m.movementDestination = new Coord(m.position);
|
||||
if (Constants.rnd.nextBoolean()) {
|
||||
m.movementDestination.x = area.area.topLeft.x + Constants.rnd.nextInt(area.area.size.width);
|
||||
} else {
|
||||
m.movementDestination.y = area.area.topLeft.y + Constants.rnd.nextInt(area.area.size.height);
|
||||
}
|
||||
}
|
||||
|
||||
// Monster is moving in a straight line.
|
||||
m.nextPosition.topLeft.set(
|
||||
m.position.x + sgn(m.movementDestination.x - m.position.x)
|
||||
|
||||
@@ -203,6 +203,9 @@ public final class Player extends Actor {
|
||||
if (v == null) return 0;
|
||||
return v;
|
||||
}
|
||||
public void setAlignment(String faction, int newValue) {
|
||||
alignments.put(faction, newValue);
|
||||
}
|
||||
public void addAlignment(String faction, int delta) {
|
||||
int newValue = getAlignment(faction) + delta;
|
||||
alignments.put(faction, newValue);
|
||||
|
||||
@@ -8,6 +8,7 @@ public final class ScriptEffect {
|
||||
, actorCondition
|
||||
, actorConditionImmunity
|
||||
, alignmentChange
|
||||
, alignmentSet
|
||||
, giveItem
|
||||
, createTimer
|
||||
, spawnAll
|
||||
|
||||
@@ -3,15 +3,6 @@ package com.gpl.rpg.AndorsTrail.resource.tiles;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailPreferences;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.ability.ActorConditionType;
|
||||
@@ -27,6 +18,19 @@ import com.gpl.rpg.AndorsTrail.model.map.MonsterSpawnArea;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.PredefinedMap;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.TMXMapTranslator;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public final class TileManager {
|
||||
public static final int CHAR_HERO = 1;
|
||||
public static final int iconID_selection_red = 2;
|
||||
@@ -216,6 +220,7 @@ public final class TileManager {
|
||||
public void setImageViewTileForPlayer(Resources res, ImageView imageView, int iconID) { setImageViewTile(res, imageView, preloadedTiles.getBitmap(iconID)); }
|
||||
// public void setImageViewTile(Resources res, ImageView imageView, ActorConditionType conditionType) { setImageViewTile(res, imageView, preloadedTiles.getBitmap(conditionType.iconID)); }
|
||||
public void setImageViewTile(Resources res, ImageView imageView, ActorConditionType conditionType, boolean immunityOverlay) { setImageViewTile(res, imageView, preloadedTiles.getBitmap(conditionType.iconID), immunityOverlay); }
|
||||
public void setImageViewTile(Resources res, ImageView imageView, ActorConditionType conditionType, boolean immunityOverlay, String exponent, String index) { setImageViewTile(res, imageView, preloadedTiles.getBitmap(conditionType.iconID), immunityOverlay, exponent, index); }
|
||||
public void setImageViewTileForUIIcon(Resources res, ImageView imageView, int iconID) { setImageViewTile(res, imageView, preloadedTiles.getBitmap(iconID)); }
|
||||
public void setImageViewTile(Resources res, ImageView imageView, Bitmap b) {
|
||||
if (density > 1) {
|
||||
@@ -225,20 +230,41 @@ public final class TileManager {
|
||||
}
|
||||
}
|
||||
public void setImageViewTile(Resources res, ImageView imageView, Bitmap b, boolean immunityOverlay) {
|
||||
if (!immunityOverlay) setImageViewTile(res, imageView, b);
|
||||
setImageViewTile(res, imageView, b, immunityOverlay, null, null);
|
||||
}
|
||||
public void setImageViewTile(Resources res, ImageView imageView, Bitmap b, boolean immunityOverlay, String exponent, String index) {
|
||||
if (!immunityOverlay && exponent == null && index == null) setImageViewTile(res, imageView, b);
|
||||
else {
|
||||
Drawable[] layers = new Drawable[2];
|
||||
Drawable[] layers = new Drawable[1+
|
||||
(immunityOverlay ? 1 : 0)+
|
||||
(exponent != null ? 1 : 0)+
|
||||
(index != null ? 1 : 0)];
|
||||
int tileWidth;
|
||||
if (density > 1) {
|
||||
layers[0] = new BitmapDrawable(res, Bitmap.createScaledBitmap(b, (int)(tileSize*density), (int)(tileSize*density), true));
|
||||
layers[1] = new BitmapDrawable(res, preloadedTiles.getBitmap(iconID_immunity_overlay));
|
||||
tileWidth = (int)(tileSize*density);
|
||||
layers[0] = new BitmapDrawable(res, Bitmap.createScaledBitmap(b, tileWidth, tileWidth, true));
|
||||
} else {
|
||||
tileWidth = tileSize;
|
||||
layers[0] = new BitmapDrawable(res, b);
|
||||
layers[1] = new BitmapDrawable(res, preloadedTiles.getBitmap(iconID_immunity_overlay));
|
||||
}
|
||||
int nextIndex = 1;
|
||||
if (immunityOverlay) {
|
||||
layers[nextIndex] = new BitmapDrawable(res, preloadedTiles.getBitmap(iconID_immunity_overlay));
|
||||
nextIndex++;
|
||||
}
|
||||
if (exponent != null) {
|
||||
layers[nextIndex] = new TextDrawable(res, tileWidth, tileWidth, exponent, TextDrawable.Align.TOP_RIGHT);
|
||||
nextIndex++;
|
||||
}
|
||||
if (index != null) {
|
||||
layers[nextIndex] = new TextDrawable(res, tileWidth, tileWidth, index, TextDrawable.Align.BOTTOM_RIGHT);
|
||||
nextIndex++;
|
||||
}
|
||||
LayerDrawable layered = new LayerDrawable(layers);
|
||||
setImageViewTile(imageView, layered);
|
||||
}
|
||||
}
|
||||
|
||||
public void setImageViewTile(ImageView imageView, Drawable d) {
|
||||
imageView.setImageDrawable(d);
|
||||
}
|
||||
@@ -257,20 +283,19 @@ public final class TileManager {
|
||||
overlayDrawable = new BitmapDrawable(res, preloadedTiles.getBitmap(overlayIconID));
|
||||
iconDrawable = new BitmapDrawable(res, icon);
|
||||
}
|
||||
|
||||
if (overlayAbove) {
|
||||
setImageViewTile(imageView,
|
||||
new LayerDrawable(new Drawable[] {
|
||||
iconDrawable
|
||||
,overlayDrawable
|
||||
})
|
||||
);
|
||||
LayerDrawable layered = new LayerDrawable(new Drawable[] {
|
||||
iconDrawable
|
||||
,overlayDrawable
|
||||
});
|
||||
setImageViewTile(imageView, layered);
|
||||
} else {
|
||||
setImageViewTile(imageView,
|
||||
new LayerDrawable(new Drawable[] {
|
||||
overlayDrawable
|
||||
,iconDrawable
|
||||
})
|
||||
);
|
||||
LayerDrawable layered = new LayerDrawable(new Drawable[] {
|
||||
overlayDrawable
|
||||
,iconDrawable
|
||||
});
|
||||
setImageViewTile(imageView, layered);
|
||||
}
|
||||
} else {
|
||||
setImageViewTile(res, imageView, icon);
|
||||
@@ -336,4 +361,143 @@ public final class TileManager {
|
||||
}
|
||||
}).execute();
|
||||
}
|
||||
|
||||
private static class TextDrawable extends Drawable {
|
||||
|
||||
private String text;
|
||||
private int size = 15;
|
||||
private Align align = Align.CENTER;
|
||||
private Paint mPaint;
|
||||
private Rect textBounds;
|
||||
private int cHeight;
|
||||
private int cWidth;
|
||||
|
||||
public enum Align {
|
||||
TOP,
|
||||
TOP_LEFT,
|
||||
TOP_RIGHT,
|
||||
CENTER,
|
||||
LEFT,
|
||||
RIGHT,
|
||||
BOTTOM,
|
||||
BOTTOM_LEFT,
|
||||
BOTTOM_RIGHT
|
||||
}
|
||||
|
||||
public TextDrawable(Resources res, int cWidth, int cHeight, String text, Align align, int size) {
|
||||
this.text= text;
|
||||
this.align = align;
|
||||
this.size = size;
|
||||
this.cWidth = cWidth;
|
||||
this.cHeight = cHeight;
|
||||
init(res);
|
||||
}
|
||||
|
||||
public TextDrawable(Resources res, int cWidth, int cHeight, String text, Align align) {
|
||||
this.text= text;
|
||||
this.align = align;
|
||||
this.cWidth = cWidth;
|
||||
this.cHeight = cHeight;
|
||||
init(res);
|
||||
}
|
||||
|
||||
public TextDrawable(Resources res, int cWidth, int cHeight, String text) {
|
||||
this.text= text;
|
||||
this.cWidth = cWidth;
|
||||
this.cHeight = cHeight;
|
||||
init(res);
|
||||
}
|
||||
|
||||
public void init(Resources res) {
|
||||
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
|
||||
mPaint.setColor(res.getColor(android.R.color.black));
|
||||
mPaint.setShadowLayer(1, 1, 1, res.getColor(android.R.color.white));
|
||||
mPaint.setStyle(Paint.Style.FILL);
|
||||
mPaint.setTextSize(size * res.getDisplayMetrics().scaledDensity);
|
||||
textBounds = new Rect();
|
||||
mPaint.getTextBounds(text, 0, text.length(), textBounds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
float x,y;
|
||||
switch (align) {
|
||||
case BOTTOM:
|
||||
case BOTTOM_LEFT:
|
||||
case BOTTOM_RIGHT:
|
||||
y = cHeight - textBounds.bottom;
|
||||
break;
|
||||
case CENTER:
|
||||
case LEFT:
|
||||
case RIGHT:
|
||||
y = (cHeight - textBounds.height()) / 2;
|
||||
break;
|
||||
case TOP:
|
||||
case TOP_LEFT:
|
||||
case TOP_RIGHT:
|
||||
default:
|
||||
y = 0 - textBounds.top;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (align) {
|
||||
case BOTTOM:
|
||||
case CENTER:
|
||||
case TOP:
|
||||
x = (cWidth - textBounds.width()) / 2;
|
||||
break;
|
||||
case BOTTOM_LEFT:
|
||||
case LEFT:
|
||||
case TOP_LEFT:
|
||||
default:
|
||||
x = 0 - textBounds.left;
|
||||
break;
|
||||
case BOTTOM_RIGHT:
|
||||
case RIGHT:
|
||||
case TOP_RIGHT:
|
||||
x = cWidth - textBounds.right;
|
||||
break;
|
||||
|
||||
}
|
||||
canvas.drawText(text, x, y, mPaint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlpha(int alpha) {
|
||||
mPaint.setAlpha(alpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter cf) {
|
||||
mPaint.setColorFilter(cf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOpacity() {
|
||||
return mPaint.getAlpha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicWidth() {
|
||||
return cWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicHeight() {
|
||||
return cHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getPadding(Rect padding) {
|
||||
padding.bottom = 0;
|
||||
padding.top = 0;
|
||||
padding.left = 0;
|
||||
padding.right = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.gpl.rpg.AndorsTrail.view;
|
||||
|
||||
import android.R.color;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.Animation.AnimationListener;
|
||||
import android.view.animation.AnimationUtils;
|
||||
@@ -12,6 +14,7 @@ import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailPreferences;
|
||||
import com.gpl.rpg.AndorsTrail.Dialogs;
|
||||
@@ -19,21 +22,26 @@ import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.ControllerContext;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.controller.CombatController;
|
||||
import com.gpl.rpg.AndorsTrail.controller.listeners.ActorConditionListener;
|
||||
import com.gpl.rpg.AndorsTrail.controller.listeners.ActorStatsListener;
|
||||
import com.gpl.rpg.AndorsTrail.controller.listeners.CombatSelectionListener;
|
||||
import com.gpl.rpg.AndorsTrail.controller.listeners.CombatTurnListener;
|
||||
import com.gpl.rpg.AndorsTrail.model.ability.ActorCondition;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Actor;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Monster;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Player;
|
||||
import com.gpl.rpg.AndorsTrail.util.Coord;
|
||||
|
||||
public final class CombatView extends RelativeLayout implements CombatSelectionListener, CombatTurnListener, ActorStatsListener {
|
||||
public final class CombatView extends RelativeLayout implements CombatSelectionListener, CombatTurnListener, ActorStatsListener, ActorConditionListener {
|
||||
private final TextView statusTextView;
|
||||
private final Button attackMoveButton;
|
||||
private final ImageButton monsterInfo;
|
||||
private final RangeBar monsterHealth;
|
||||
private final View monsterBar;
|
||||
private final View actionBar;
|
||||
private final ImageButton monsterConditionsButton;
|
||||
private final RelativeLayout activeConditionsBar;
|
||||
private DisplayActiveActorConditionIcons activeConditions;
|
||||
private final ViewGroup monsterBar;
|
||||
private final ViewGroup actionBar;
|
||||
private final TextView monsterActionText;
|
||||
|
||||
private final WorldContext world;
|
||||
@@ -43,8 +51,13 @@ public final class CombatView extends RelativeLayout implements CombatSelectionL
|
||||
private final Player player;
|
||||
private final Animation displayAnimation;
|
||||
private final Animation hideAnimation;
|
||||
private final Animation displayConditionsButtonAnimation;
|
||||
private final Animation hideConditionsButtonAnimation;
|
||||
private final Animation displayConditionsBarAnimation;
|
||||
private final Animation hideConditionsBarAnimation;
|
||||
|
||||
private Monster currentMonster;
|
||||
private boolean conditionsBarToggled = false;
|
||||
|
||||
public CombatView(final Context context, AttributeSet attr) {
|
||||
super(context, attr);
|
||||
@@ -57,7 +70,8 @@ public final class CombatView extends RelativeLayout implements CombatSelectionL
|
||||
|
||||
setFocusable(false);
|
||||
inflate(context, R.layout.combatview, this);
|
||||
this.setBackgroundResource(R.drawable.ui_gradientshape_translucent);
|
||||
findViewById(R.id.combatview_fixedarea).setBackgroundResource(R.drawable.ui_gradientshape_translucent);
|
||||
// this.setBackgroundResource(R.drawable.ui_gradientshape_translucent);
|
||||
|
||||
final CombatController c = controllers.combatController;
|
||||
attackMoveButton = (Button) findViewById(R.id.combatview_moveattack);
|
||||
@@ -95,10 +109,22 @@ public final class CombatView extends RelativeLayout implements CombatSelectionL
|
||||
|
||||
monsterHealth = (RangeBar) findViewById(R.id.combatview_monsterhealth);
|
||||
monsterHealth.init(R.drawable.ui_progress_health, R.string.combat_monsterhealth);
|
||||
monsterBar = findViewById(R.id.combatview_monsterbar);
|
||||
actionBar = findViewById(R.id.combatview_actionbar);
|
||||
monsterBar = (ViewGroup) findViewById(R.id.combatview_monsterbar);
|
||||
actionBar = (ViewGroup) findViewById(R.id.combatview_actionbar);
|
||||
monsterActionText = (TextView) findViewById(R.id.combatview_monsterismoving);
|
||||
|
||||
monsterConditionsButton = (ImageButton) findViewById(R.id.combatview_monsterconditions_button);
|
||||
monsterConditionsButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
toggleConditionsBarVisibility();
|
||||
}
|
||||
});
|
||||
|
||||
activeConditionsBar = (RelativeLayout) findViewById(R.id.combatview_activeconditions);
|
||||
activeConditions = new DisplayActiveActorConditionIcons(controllers, world, context, activeConditionsBar);
|
||||
|
||||
|
||||
monsterBar.setBackgroundColor(res.getColor(color.transparent));
|
||||
actionBar.setBackgroundColor(res.getColor(color.transparent));
|
||||
|
||||
@@ -111,8 +137,34 @@ public final class CombatView extends RelativeLayout implements CombatSelectionL
|
||||
CombatView.this.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
displayConditionsButtonAnimation = AnimationUtils.loadAnimation(context, R.anim.showmonsterconditionbutton);
|
||||
hideConditionsButtonAnimation = AnimationUtils.loadAnimation(context, R.anim.hidemonsterconditionbutton);
|
||||
hideConditionsButtonAnimation.setAnimationListener(new AnimationListener() {
|
||||
@Override public void onAnimationStart(Animation animation) {}
|
||||
@Override public void onAnimationRepeat(Animation animation) {}
|
||||
@Override public void onAnimationEnd(Animation arg0) {
|
||||
monsterConditionsButton.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
displayConditionsBarAnimation = AnimationUtils.loadAnimation(context, R.anim.showmonsterconditionbar);
|
||||
hideConditionsBarAnimation = AnimationUtils.loadAnimation(context, R.anim.hidemonsterconditionbar);
|
||||
hideConditionsBarAnimation.setAnimationListener(new AnimationListener() {
|
||||
@Override public void onAnimationStart(Animation animation) {}
|
||||
@Override public void onAnimationRepeat(Animation animation) {}
|
||||
@Override public void onAnimationEnd(Animation arg0) {
|
||||
activeConditionsBar.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void toggleConditionsBarVisibility() {
|
||||
conditionsBarToggled = !conditionsBarToggled;
|
||||
if (conditionsBarToggled) showConditionsBar();
|
||||
else hideConditionsBar();
|
||||
}
|
||||
|
||||
private void updateTurnInfo(Monster currentActiveMonster) {
|
||||
if (currentActiveMonster != null) {
|
||||
actionBar.setVisibility(View.INVISIBLE);
|
||||
@@ -144,8 +196,73 @@ public final class CombatView extends RelativeLayout implements CombatSelectionL
|
||||
currentMonster = selectedMonster;
|
||||
}
|
||||
updateAttackMoveButtonText(selectedMonster != null);
|
||||
updateConditions();
|
||||
}
|
||||
|
||||
private void updateConditions() {
|
||||
activeConditions.setTarget(currentMonster);
|
||||
if (currentMonster == null) {
|
||||
hideConditionsButton();
|
||||
return;
|
||||
}
|
||||
if (currentMonster.conditions.size()+currentMonster.immunities.size() > 0) {
|
||||
if (currentMonster.conditions.size() > 0) world.tileManager.setImageViewTile(res, monsterConditionsButton, currentMonster.conditions.get(0).conditionType, false, Integer.toString(currentMonster.conditions.size()+currentMonster.immunities.size()), null);
|
||||
else world.tileManager.setImageViewTile(res, monsterConditionsButton, currentMonster.immunities.get(0).conditionType, true, Integer.toString(currentMonster.conditions.size()+currentMonster.immunities.size()), null);
|
||||
showConditionsButton();
|
||||
if (conditionsBarToggled) showConditionsBar();
|
||||
} else {
|
||||
hideConditionsButton();
|
||||
hideConditionsBar();
|
||||
}
|
||||
}
|
||||
|
||||
private void showConditionsButton() {
|
||||
if (monsterConditionsButton.getVisibility() != View.VISIBLE) {
|
||||
monsterConditionsButton.setVisibility(View.VISIBLE);
|
||||
if (preferences.enableUiAnimations) {
|
||||
monsterConditionsButton.startAnimation(displayConditionsButtonAnimation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void hideConditionsButton() {
|
||||
if (monsterConditionsButton.getVisibility() == View.VISIBLE) {
|
||||
if (preferences.enableUiAnimations) {
|
||||
monsterConditionsButton.startAnimation(hideConditionsButtonAnimation);
|
||||
} else {
|
||||
monsterConditionsButton.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void showConditionsBar() {
|
||||
if (activeConditionsBar.getVisibility() != View.VISIBLE) {
|
||||
activeConditionsBar.setVisibility(View.VISIBLE);
|
||||
if (preferences.enableUiAnimations) {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
// monsterBar.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
|
||||
// }
|
||||
activeConditionsBar.startAnimation(displayConditionsBarAnimation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void hideConditionsBar() {
|
||||
if (activeConditionsBar.getVisibility() == View.VISIBLE) {
|
||||
if (preferences.enableUiAnimations) {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
// monsterBar.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
|
||||
// }
|
||||
activeConditionsBar.startAnimation(hideConditionsBarAnimation);
|
||||
} else {
|
||||
activeConditionsBar.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateAttackMoveButtonText() {
|
||||
updateAttackMoveButtonText(world.model.uiSelections.selectedMonster != null);
|
||||
}
|
||||
@@ -183,11 +300,15 @@ public final class CombatView extends RelativeLayout implements CombatSelectionL
|
||||
controllers.combatController.combatSelectionListeners.add(this);
|
||||
controllers.combatController.combatTurnListeners.add(this);
|
||||
controllers.actorStatsController.actorStatsListeners.add(this);
|
||||
controllers.actorStatsController.actorConditionListeners.add(this);
|
||||
activeConditions.subscribe();
|
||||
}
|
||||
public void unsubscribe() {
|
||||
controllers.actorStatsController.actorStatsListeners.remove(this);
|
||||
controllers.combatController.combatTurnListeners.remove(this);
|
||||
controllers.combatController.combatSelectionListeners.remove(this);
|
||||
controllers.actorStatsController.actorConditionListeners.remove(this);
|
||||
activeConditions.unsubscribe();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -245,4 +366,40 @@ public final class CombatView extends RelativeLayout implements CombatSelectionL
|
||||
public void onActorMoveCostChanged(Actor actor, int newMoveCost) {
|
||||
if (actor == player) updateAttackMoveButtonText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActorConditionAdded(Actor actor, ActorCondition condition) {
|
||||
if (actor == currentMonster) updateConditions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActorConditionRemoved(Actor actor, ActorCondition condition) {
|
||||
if (actor == currentMonster) updateConditions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActorConditionDurationChanged(Actor actor, ActorCondition condition) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActorConditionMagnitudeChanged(Actor actor, ActorCondition condition) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActorConditionRoundEffectApplied(Actor actor, ActorCondition condition) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActorConditionImmunityAdded(Actor actor, ActorCondition condition) {
|
||||
if (actor == currentMonster) updateConditions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActorConditionImmunityRemoved(Actor actor, ActorCondition condition) {
|
||||
if (actor == currentMonster) updateConditions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActorConditionImmunityDurationChanged(Actor actor, ActorCondition condition) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.gpl.rpg.AndorsTrail.view;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.graphics.drawable.GradientDrawable.Orientation;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.Animation.AnimationListener;
|
||||
@@ -10,6 +16,7 @@ import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.RelativeLayout.LayoutParams;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailPreferences;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.ControllerContext;
|
||||
@@ -19,9 +26,6 @@ import com.gpl.rpg.AndorsTrail.model.ability.ActorCondition;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Actor;
|
||||
import com.gpl.rpg.AndorsTrail.resource.tiles.TileManager;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public final class DisplayActiveActorConditionIcons implements ActorConditionListener {
|
||||
|
||||
private final AndorsTrailPreferences preferences;
|
||||
@@ -31,6 +35,8 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
private final RelativeLayout activeConditions;
|
||||
private final ArrayList<ActiveConditionIcon> currentConditionIcons = new ArrayList<ActiveConditionIcon>();
|
||||
private final WeakReference<Context> androidContext;
|
||||
|
||||
private Actor target;
|
||||
|
||||
public DisplayActiveActorConditionIcons(
|
||||
final ControllerContext controllers,
|
||||
@@ -44,10 +50,16 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
this.androidContext = new WeakReference<Context>(androidContext);
|
||||
this.activeConditions = activeConditions;
|
||||
}
|
||||
|
||||
public void setTarget(Actor target) {
|
||||
if (this.target == target) return;
|
||||
this.target = target;
|
||||
cleanUp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActorConditionAdded(Actor actor, ActorCondition condition) {
|
||||
if (actor != world.model.player) return;
|
||||
if (actor != target) return;
|
||||
ActiveConditionIcon icon = getFirstFreeIcon();
|
||||
icon.setActiveCondition(condition, false);
|
||||
icon.show();
|
||||
@@ -55,7 +67,7 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
|
||||
@Override
|
||||
public void onActorConditionRemoved(Actor actor, ActorCondition condition) {
|
||||
if (actor != world.model.player) return;
|
||||
if (actor != target) return;
|
||||
ActiveConditionIcon icon = getIconFor(condition, false);
|
||||
if (icon == null) return;
|
||||
icon.hide(true);
|
||||
@@ -67,7 +79,7 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
|
||||
@Override
|
||||
public void onActorConditionMagnitudeChanged(Actor actor, ActorCondition condition) {
|
||||
if (actor != world.model.player) return;
|
||||
if (actor != target) return;
|
||||
ActiveConditionIcon icon = getIconFor(condition, false);
|
||||
if (icon == null) return;
|
||||
icon.setIconText();
|
||||
@@ -75,7 +87,7 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
|
||||
@Override
|
||||
public void onActorConditionRoundEffectApplied(Actor actor, ActorCondition condition) {
|
||||
if (actor != world.model.player) return;
|
||||
if (actor != target) return;
|
||||
ActiveConditionIcon icon = getIconFor(condition, false);
|
||||
if (icon == null) return;
|
||||
icon.pulseAnimate();
|
||||
@@ -84,7 +96,7 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
|
||||
@Override
|
||||
public void onActorConditionImmunityAdded(Actor actor, ActorCondition condition) {
|
||||
if (actor != world.model.player) return;
|
||||
if (actor != target) return;
|
||||
ActiveConditionIcon icon = getFirstFreeIcon();
|
||||
icon.setActiveCondition(condition, true);
|
||||
icon.show();
|
||||
@@ -92,7 +104,7 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
|
||||
@Override
|
||||
public void onActorConditionImmunityRemoved(Actor actor, ActorCondition condition) {
|
||||
if (actor != world.model.player) return;
|
||||
if (actor != target) return;
|
||||
ActiveConditionIcon icon = getIconFor(condition, true);
|
||||
if (icon == null) return;
|
||||
icon.hide(true);
|
||||
@@ -108,15 +120,21 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
}
|
||||
|
||||
public void subscribe() {
|
||||
for (ActiveConditionIcon icon : currentConditionIcons) icon.hide(false);
|
||||
for (ActorCondition condition : world.model.player.conditions) {
|
||||
getFirstFreeIcon().setActiveCondition(condition, false);
|
||||
}
|
||||
for (ActorCondition condition : world.model.player.immunities) {
|
||||
getFirstFreeIcon().setActiveCondition(condition, true);
|
||||
}
|
||||
cleanUp();
|
||||
controllers.actorStatsController.actorConditionListeners.add(this);
|
||||
}
|
||||
|
||||
private void cleanUp() {
|
||||
for (ActiveConditionIcon icon : currentConditionIcons) icon.hide(false);
|
||||
if (target != null) {
|
||||
for (ActorCondition condition : target.conditions) {
|
||||
getFirstFreeIcon().setActiveCondition(condition, false);
|
||||
}
|
||||
for (ActorCondition condition : target.immunities) {
|
||||
getFirstFreeIcon().setActiveCondition(condition, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final class ActiveConditionIcon implements AnimationListener {
|
||||
public final int id;
|
||||
@@ -133,6 +151,9 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
this.id = id;
|
||||
this.image = new ImageView(context);
|
||||
this.image.setId(id);
|
||||
GradientDrawable grad = new GradientDrawable(target == world.model.player ? Orientation.BOTTOM_TOP : Orientation.TOP_BOTTOM, new int[]{Color.argb(190, 68, 68, 68), Color.argb(10, 34, 34, 34)});
|
||||
grad.setCornerRadius(3);
|
||||
this.image.setBackgroundDrawable(grad);
|
||||
this.text = new TextView(context);
|
||||
this.onNewIconAnimation = AnimationUtils.loadAnimation(context, R.anim.scaleup);
|
||||
this.onRemovedIconAnimation = AnimationUtils.loadAnimation(context, R.anim.scaledown);
|
||||
@@ -227,7 +248,8 @@ public final class DisplayActiveActorConditionIcons implements ActorConditionLis
|
||||
|
||||
private RelativeLayout.LayoutParams getLayoutParamsForIconIndex(int index) {
|
||||
RelativeLayout.LayoutParams layout = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
|
||||
layout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
|
||||
if (target == world.model.player) layout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
|
||||
else layout.addRule(RelativeLayout.ALIGN_PARENT_TOP);
|
||||
if (index == 0) {
|
||||
layout.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
||||
} else {
|
||||
|
||||
86
contributors.md
Normal file
86
contributors.md
Normal file
@@ -0,0 +1,86 @@
|
||||
## Andor's Trail Contribution List
|
||||
**(In alphabetical order)**
|
||||
|
||||
Additional maps by:
|
||||
- Michael Schmid
|
||||
- Pete Wheeler
|
||||
----------
|
||||
Additional programming by:
|
||||
- Ethan Wessel
|
||||
- Florian Doublet
|
||||
- Lucas Delvallet
|
||||
- M.H. Alkotob
|
||||
- Olivier Dragon
|
||||
- Olivier Samyn
|
||||
- Samuel Plentz
|
||||
- Scott Lund
|
||||
- Uwe Jugel
|
||||
----------
|
||||
Russian translation by:
|
||||
- Aleksey Kabanov
|
||||
- Alexander Zubok
|
||||
- Dreamer...
|
||||
- dromoz
|
||||
- e.solodookhin
|
||||
- konstmih
|
||||
- istasman
|
||||
- Paul Sulemenkov
|
||||
- shell.andor
|
||||
----------
|
||||
Italian translation by:
|
||||
- Andrea Luciano Damico
|
||||
- Joker
|
||||
- k6blue
|
||||
- liogiu
|
||||
----------
|
||||
French translation by:
|
||||
- LeSanglier
|
||||
- Marwane K.
|
||||
- Misty Soul
|
||||
- olivier
|
||||
- zorun.42
|
||||
----------
|
||||
German translation by:
|
||||
- Bomber
|
||||
- Samuel Plentz
|
||||
- cngunners14
|
||||
- Phoenixor
|
||||
- Tutar
|
||||
- Mütze
|
||||
----------
|
||||
English proofreading by:
|
||||
- taws34
|
||||
- Elyon
|
||||
----------
|
||||
English proofreading and testing by:
|
||||
- Stephen Stalnaker
|
||||
----------
|
||||
Hebrew translation by:
|
||||
- eitanbm
|
||||
----------
|
||||
Portuguese(PT) translation by:
|
||||
- mira
|
||||
----------
|
||||
Portuguese(BR) translation by:
|
||||
- Mauro Carvalho Chehab
|
||||
----------
|
||||
Japanese translation by:
|
||||
- surgecurrent
|
||||
----------
|
||||
Polish translation by:
|
||||
- DanielS
|
||||
- Piotr Wieczorek
|
||||
- siemens
|
||||
- tobik9090
|
||||
----------
|
||||
Forum moderated by:
|
||||
- Brent May
|
||||
- Josh Kloos
|
||||
- Matthew B. White (Nyktos)
|
||||
- Tim Davis
|
||||
- Travis Miller
|
||||
----------
|
||||
Additional ideas and content by:
|
||||
- Nicholas Franks (Taledus)
|
||||
- Tom Jobes
|
||||
- Stan Meirerion
|
||||
52
gfxcontrib.md
Normal file
52
gfxcontrib.md
Normal file
@@ -0,0 +1,52 @@
|
||||
## Graphics Contributors
|
||||
Most of the graphical resources are licensed under some kind of CC sharealike license, as stated on their corresponding pages that we link to (see below). Some are CC or GPL in their original form, but some are not, and Andor's Trail has gotten explicit written approval from the author(s) to use them to this project. If you would like to use some of these resources you will be required to get your own explicit written approval.
|
||||
|
||||
Item tilesets graphics by [Ails](http://ails.deviantart.com/art/420-Pixel-Art-Icons-for-RPG-129892453).
|
||||
|
||||
Some hero graphics by [RedKnight91](http://redknight91.deviantart.com/art/Arena-Game-Sprites-154661559).
|
||||
|
||||
Additional monster graphics by [nacred](http://nacred.deviantart.com/art/Sprite-Sheet-171751308).
|
||||
|
||||
Monster tileset graphics by [RL Tiles](http://rltiles.sourceforge.net/) Part of (or All) the graphic tiles used in this program is the public domain roguelike tileset “RLTiles”. Some of the tiles have been modified by Oskar Wiksten. You can find the original tileset at the link above.
|
||||
|
||||
Some of the graphic data in this software are free game resources distributed by [REFMAP](http://www.tekepon.net/fsm) You must not use the graphic data which is in this software, for the purpose except playing this game. When you want to get these resources, go to the website above.
|
||||
|
||||
Map tilesets graphics partly by [telles0808](http://telles0808.deviantart.com/art/RPG-Maker-VX-RTP-Tileset-159218223).
|
||||
|
||||
Meway, Len Pabin, Auran, Silviyius [Item Icons](https://opengameart.org/content/whispers-of-avalon-item-icons)
|
||||
|
||||
Stephen Challener (Redshrike) [Enemies](https://opengameart.org/content/10-basic-rpg-enemies) and [more](https://opengameart.org/content/more-rpg-enemies)
|
||||
|
||||
Jorge.Avila [Skull](https://opengameart.org/content/skull)
|
||||
|
||||
Gwes [Items](https://opengameart.org/content/dark-fantasy-item-sprites)
|
||||
|
||||
David Gervais [Additional Graphics](http://pousse.rapiere.free.fr/tome/)
|
||||
|
||||
turin [Additional Graphics](http://forums.wesnoth.org/viewtopic.php?f=19&t=12207&start=75)
|
||||
|
||||
artisticdude [Zombie Skeletons](https://opengameart.org/content/zombies-skeletons)
|
||||
|
||||
Mindflayer/Necroleachate [Additional Graphics](http://pixelhack.blogspot.com/)
|
||||
|
||||
Artur Reterski [Item Set](https://opengameart.org/content/items-set)
|
||||
|
||||
Daniel Eddeland [Tileset](https://opengameart.org/content/farming-tilesets-magic-animations-and-ui-elements)
|
||||
|
||||
Lanea Zimmerman (AKA Sharm) [Tileset](https://opengameart.org/content/liberated-pixel-cup-base-assets-sprites-map-tiles)
|
||||
|
||||
Gnome icon artists [Additional Graphics](http://art.gnome.org/themes/icon)
|
||||
|
||||
Paladin-Cleric of Awesome [Additional Graphics](http://forums.rpgmakerweb.com/index.php?/topic/5434-its-a-mad-mad-mad-mad-world-maddies-edits-and-clumping/)
|
||||
|
||||
Ayene-chan [Tileset](https://ayene-chan.deviantart.com/gallery/32324562/RPG-Maker)
|
||||
|
||||
Mack [Tileset](https://vxresource.wordpress.com/2010/03/17/the-real-macks-tileset/)
|
||||
|
||||
Avery, Gits [Tileset](https://forums.rpgmakerweb.com/index.php?threads/amazing-avys-awesome-arrrpg-maker-stuff.9178/)
|
||||
|
||||
DeBray Bailey
|
||||
|
||||
Karvis
|
||||
|
||||
vxresource [Tileset](https://vxresource.wordpress.com/category/resources/tilesets/) (This website shares tiles with the general public for free with the agreement of their original creators.)
|
||||
51
readme.md
Normal file
51
readme.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Andor's Trail
|
||||
|
||||
Andor's Trail is a single-player quest-driven roguelike fantasy dungeon crawler RPG with a powerful story.
|
||||
|
||||
Uncover the truths about your home village and the disappearance of your brother. Battle fierce monsters, gain experience and levels. Solve quests, find hidden treasures and improve your equipment.
|
||||
|
||||
## News/Updates
|
||||
|
||||
[Latest project status](https://andorstrail.com/viewtopic.php?f=5&t=5506)
|
||||
|
||||
## Contributing
|
||||
|
||||
Please read [here](https://andorstrail.com/viewtopic.php?f=6&t=4560) for details on how to contribute, and the process for submitting any content.
|
||||
|
||||
### Andor's Trail Content Studio
|
||||
A Win/Mac/Linux content creator/editor available [here](https://andorstrail.com/viewtopic.php?f=6&t=4806).
|
||||
|
||||
## APK Downloads
|
||||
|
||||
Latest version of APK available from:
|
||||
|
||||
[Google Play Store](https://play.google.com/store/apps/details?id=com.gpl.rpg.AndorsTrail)
|
||||
|
||||
[F-Droid](https://f-droid.org/packages/com.gpl.rpg.AndorsTrail/)
|
||||
|
||||
[Our Server](https://andorstrail.com/static/AndorsTrail_v0.7.1.apk)
|
||||
|
||||
## Authors
|
||||
|
||||
* **Oksar Wiksten** - *Creator* [Github Profile](https://github.com/oskarwiksten/)
|
||||
* **Kevin (Zukero)** - *Lead Developer* [Github Profile](https://github.com/Zukero/)
|
||||
* **Scott Devaney** - *Community Advocate* [Game Forums](https://andorstrail.com)
|
||||
* **Richard Jackson** - *Lead Content Wrangler*
|
||||
* **Ian Hasse** - *Lead Cartographer*
|
||||
|
||||
### Contributors List
|
||||
Additional contributors to the project are listed [here](/contributors.md).
|
||||
## Licenses
|
||||
|
||||
### Code
|
||||
Andor's Trail code is released under GNU GPL v2.
|
||||
### Content
|
||||
Andor's Trail gameplay content is copyright by their respective authors and has only been licensed for use in Andor's Trail.
|
||||
### Graphics
|
||||
The graphics licenses and contributions can be found [here](/gfxcontrib.md).
|
||||
|
||||
## Wiki
|
||||
Here is our slightly out of date [Wiki](https://www.andorstrail.com/wiki/doku.php?id=andors_trail_wiki).
|
||||
## Acknowledgments
|
||||
Additional shout-outs.
|
||||
|
||||
Reference in New Issue
Block a user