mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-01-07 04:01:45 +01:00
Merge branch 'nut_arulir_mountain' into AndorsTrailRelease_master
- All changes to PO and POT files from nut_arulir_mountain ignored, used the ones from AndorsTrailRelease_master because they contain the latest changes - Small changes to authors.xml from nut_arulir_mountain ignored, used the ones from AndorsTrailRelease_master and checked that everything is there - Current version display contains "dev". This has to be changed for the release # Conflicts: # AndorsTrail/AndroidManifest.xml # AndorsTrail/assets/translation/ar.po # AndorsTrail/assets/translation/bg.po # AndorsTrail/assets/translation/ca.po # AndorsTrail/assets/translation/cs.po # AndorsTrail/assets/translation/de.po # AndorsTrail/assets/translation/el.po # AndorsTrail/assets/translation/english.pot # AndorsTrail/assets/translation/es.po # AndorsTrail/assets/translation/es_AR.po # AndorsTrail/assets/translation/fi.po # AndorsTrail/assets/translation/fil.po # AndorsTrail/assets/translation/fr.po # AndorsTrail/assets/translation/fr_AG.po # AndorsTrail/assets/translation/gl.po # AndorsTrail/assets/translation/hu.po # AndorsTrail/assets/translation/id.po # AndorsTrail/assets/translation/it.po # AndorsTrail/assets/translation/ja.po # AndorsTrail/assets/translation/ko.po # AndorsTrail/assets/translation/ms.po # AndorsTrail/assets/translation/nb.po # AndorsTrail/assets/translation/nl.po # AndorsTrail/assets/translation/pa.po # AndorsTrail/assets/translation/pl.po # AndorsTrail/assets/translation/pt.po # AndorsTrail/assets/translation/pt_BR.po # AndorsTrail/assets/translation/ru.po # AndorsTrail/assets/translation/sl.po # AndorsTrail/assets/translation/sv.po # AndorsTrail/assets/translation/th.po # AndorsTrail/assets/translation/tr.po # AndorsTrail/assets/translation/uk.po # AndorsTrail/assets/translation/zh_CN.po # AndorsTrail/assets/translation/zh_TW.po # AndorsTrail/res/values/authors.xml # AndorsTrail/src/com/gpl/rpg/AndorsTrail/AndorsTrailApplication.java
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.gpl.rpg.AndorsTrail"
|
||||
android:versionCode="48"
|
||||
android:versionName="0.7.7"
|
||||
android:versionCode="49"
|
||||
android:versionName="0.7.8dev"
|
||||
android:installLocation="auto"
|
||||
>
|
||||
<uses-sdk
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 63 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 162 KiB |
BIN
AndorsTrail/res/drawable/monsters_arulirs.png
Normal file
BIN
AndorsTrail/res/drawable/monsters_arulirs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
AndorsTrail/res/drawable/monsters_fatboy73.png
Normal file
BIN
AndorsTrail/res/drawable/monsters_fatboy73.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
@@ -30,7 +30,19 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/ui_theme_stdframe_bitmap" >
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
style="@style/traitsinfo_label"
|
||||
android:text="@string/heroinfo_mode" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heroinfo_mode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@android:string/unknownName" />
|
||||
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -80,6 +80,38 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPersonName" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginRight="2dp"
|
||||
android:background="?attr/ui_theme_stdframe_bitmap"
|
||||
android:clickable="true"
|
||||
android:gravity="bottom|start"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/startscreen_mode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:text="@string/startscreen_game_mode" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
style="@style/AndorsTrail_Style_StdFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal" >
|
||||
<Button
|
||||
android:id="@+id/startscreen_mode_selector_button"
|
||||
style="@style/AndorsTrail_Style_SpinnerEmulator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:text="" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
},
|
||||
{
|
||||
"id":"aulowenn8",
|
||||
"message":"I don't know if was just me imagining things or if something truly happened to them. Anyway, one by one, we started to get fewer and fewer.",
|
||||
"message":"I don't know if it was just me imagining things or if something truly happened to them. Anyway, one by one, we started to get fewer and fewer.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"N",
|
||||
@@ -510,4 +510,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
},
|
||||
{
|
||||
"id":"buceth_10",
|
||||
"message":"Then, one day, a group of men come walking into the village. Shining armour, white teeth, combed hair, trimmed beards.",
|
||||
"message":"Then, one day, a group of men come walking into the village. Shining armor, white teeth, combed hair, trimmed beards.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"N",
|
||||
|
||||
@@ -327,7 +327,7 @@
|
||||
"nextPhraseID":"elythom_knight1_2"
|
||||
},
|
||||
{
|
||||
"text":"That's a very nice suit of armour you have there.",
|
||||
"text":"That's a very nice suit of armor you have there.",
|
||||
"nextPhraseID":"elythom_knight1_3"
|
||||
}
|
||||
]
|
||||
@@ -338,7 +338,7 @@
|
||||
},
|
||||
{
|
||||
"id":"elythom_knight1_3",
|
||||
"message":"Thank you, it's our standard set of armour that we use in the order. It takes a lot of scrubbing and polishing to make it this clean though."
|
||||
"message":"Thank you, it's our standard set of armor that we use in the order. It takes a lot of scrubbing and polishing to make it this clean though."
|
||||
},
|
||||
{
|
||||
"id":"elythom_knight2",
|
||||
@@ -349,7 +349,7 @@
|
||||
"nextPhraseID":"elythom_knight1_2"
|
||||
},
|
||||
{
|
||||
"text":"That's a very nice suit of armour you have there.",
|
||||
"text":"That's a very nice suit of armor you have there.",
|
||||
"nextPhraseID":"elythom_knight1_3"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
{
|
||||
"id":"glasforn_rumblings60_5_3",
|
||||
"message":"Then he laughed some more, and told me that all I had to do was kill that thing, and I would able to remove the necklace. I'm no fighter though. I was too scared to even go near it.",
|
||||
"message":"Then he laughed some more, and told me that all I had to do was kill that thing, and I would be able to remove the necklace. I'm no fighter though. I was too scared to even go near it.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"I guess you are lucky I visited, although just asking me to kill it would have been easier. And nicer.",
|
||||
|
||||
@@ -1647,7 +1647,7 @@
|
||||
},
|
||||
{
|
||||
"id":"algore_x81",
|
||||
"message":"The magical barrier at the cemetary could only be penetrated by someone carrying the text, which contained several magical inscriptions.",
|
||||
"message":"The magical barrier at the cemetery could only be penetrated by someone carrying the text, which contained several magical inscriptions.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"N",
|
||||
@@ -1667,7 +1667,7 @@
|
||||
},
|
||||
{
|
||||
"id":"graveyardtraveler_60",
|
||||
"message":" Maybe he knows more. You should give him a visit.",
|
||||
"message":"Maybe he knows more. You should give him a visit.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"OK, I'll do that.",
|
||||
@@ -2654,4 +2654,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -1818,7 +1818,7 @@
|
||||
},
|
||||
{
|
||||
"id":"lodar_andor21",
|
||||
"message":"I tell you, something affected the forest. Myself, I felt my stomach turning even more often that it usually does.",
|
||||
"message":"I tell you, something affected the forest. Myself, I felt my stomach turning even more often than it usually does.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"N",
|
||||
|
||||
@@ -1757,7 +1757,7 @@
|
||||
},
|
||||
{
|
||||
"id":"glasforn_rumblings60_5_3",
|
||||
"message":"Then he laughed some more, and told me that all I had to do was kill that thing, and I would able to remove the necklace. I'm no fighter though. I was too scared to even go near it.",
|
||||
"message":"Then he laughed some more, and told me that all I had to do was kill that thing, and I would be able to remove the necklace. I'm no fighter though. I was too scared to even go near it.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"I guess you are lucky I visited, although just asking me to kill it would have been easier. And nicer.",
|
||||
|
||||
@@ -4771,7 +4771,7 @@
|
||||
},
|
||||
{
|
||||
"id":"stoutford_castle_3b",
|
||||
"message":"Gain? I am the the one who gains!",
|
||||
"message":"Gain? I am the one who gains!",
|
||||
"replies":[
|
||||
{
|
||||
"text":"No, that's not acceptable. Do you have anything better to offer?",
|
||||
|
||||
@@ -1094,7 +1094,7 @@
|
||||
},
|
||||
{
|
||||
"id":"ulirfendor_helmet_4",
|
||||
"message":"I am not certain of what the term 'The Dark Protector' refers to. At first I thought it might be some creature protecting something, but this helmet seems to fit better in on what the shrine speaks of.",
|
||||
"message":"I am not certain of what the term 'The Dark Protector' refers to. At first I thought it might be some creature protecting something, but this helmet seems to better fit what the shrine speaks of.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"N",
|
||||
@@ -1514,7 +1514,7 @@
|
||||
},
|
||||
{
|
||||
"id":"ulirfendor_dp_bless_2",
|
||||
"message":"The blessing will grant you the aid of the Shadow while in combat, protecting you from harmful effects that you opponent might inflict upon you.",
|
||||
"message":"The blessing will grant you the aid of the Shadow while in combat, protecting you from harmful effects that your opponent might inflict upon you.",
|
||||
"replies":[
|
||||
{
|
||||
"text":"Thank you, but that will not be necessary. I am just happy to help.",
|
||||
@@ -1638,4 +1638,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
},
|
||||
{
|
||||
"id":"sign_rbfcr1_3",
|
||||
"message":"While examining them, you recall the the old man Ogam in Vilegard spoke of some 'Rocky Formations'. Could this be what he was referring to? If that is the case, you wonder if this path might lead to Lodar's hideaway.",
|
||||
"message":"While examining them, you recall the old man Ogam in Vilegard spoke of some 'Rocky Formations'. Could this be what he was referring to? If that is the case, you wonder if this path might lead to Lodar's hideaway.",
|
||||
"rewards":[
|
||||
{
|
||||
"rewardType":"questProgress",
|
||||
|
||||
@@ -97,6 +97,13 @@
|
||||
"size":"large",
|
||||
"inventorySlot":"weapon"
|
||||
},
|
||||
{
|
||||
"id":"pole",
|
||||
"name":"Pole weapon",
|
||||
"actionType":"equip",
|
||||
"size":"large",
|
||||
"inventorySlot":"weapon"
|
||||
},
|
||||
{
|
||||
"id":"buckler",
|
||||
"name":"Buckler",
|
||||
|
||||
@@ -5,12 +5,5 @@
|
||||
"actionType":"equip",
|
||||
"size":"std",
|
||||
"inventorySlot":"weapon"
|
||||
},
|
||||
{
|
||||
"id":"scythe",
|
||||
"name":"Scythe",
|
||||
"actionType":"equip",
|
||||
"size":"large",
|
||||
"inventorySlot":"weapon"
|
||||
}
|
||||
]
|
||||
@@ -44,7 +44,7 @@
|
||||
{
|
||||
"id":"armor2",
|
||||
"iconID":"items_armours:15",
|
||||
"name":"Superior leather armour",
|
||||
"name":"Superior leather armor",
|
||||
"baseMarketCost":624,
|
||||
"category":"bdy_lthr",
|
||||
"equipEffect":{
|
||||
@@ -54,7 +54,7 @@
|
||||
{
|
||||
"id":"armor3",
|
||||
"iconID":"items_armours:16",
|
||||
"name":"Hard leather armour",
|
||||
"name":"Hard leather armor",
|
||||
"baseMarketCost":2407,
|
||||
"category":"bdy_lthr",
|
||||
"equipEffect":{
|
||||
@@ -64,7 +64,7 @@
|
||||
{
|
||||
"id":"armor4",
|
||||
"iconID":"items_armours:16",
|
||||
"name":"Superior hard leather armour",
|
||||
"name":"Superior hard leather armor",
|
||||
"baseMarketCost":3866,
|
||||
"category":"bdy_lthr",
|
||||
"equipEffect":{
|
||||
|
||||
@@ -79,9 +79,11 @@
|
||||
"category":"food",
|
||||
"description":"Even fly larvae have died eating this.",
|
||||
"useEffect":{
|
||||
|
||||
|
||||
"increaseCurrentHP":{
|
||||
"min":-10,
|
||||
"max":-15
|
||||
"min":-15,
|
||||
"max":-10
|
||||
},
|
||||
"conditionsSource":[
|
||||
{
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
"iconID":"items_weapons_3:3",
|
||||
"name":"Scythe",
|
||||
"displaytype":"ordinary",
|
||||
"category":"scythe",
|
||||
"category":"pole",
|
||||
"description":"This looks more suited to farming than fighting",
|
||||
"equipEffect":{
|
||||
"increaseAttackDamage":{
|
||||
@@ -207,7 +207,7 @@
|
||||
"displaytype":"ordinary",
|
||||
"hasManualPrice":1,
|
||||
"baseMarketCost":464,
|
||||
"category":"scythe",
|
||||
"category":"pole",
|
||||
"description":"This looks more suited to farming than fighting",
|
||||
"equipEffect":{
|
||||
"increaseAttackDamage":{
|
||||
|
||||
@@ -417,7 +417,7 @@
|
||||
{
|
||||
"id":"armour_crude_leather",
|
||||
"iconID":"items_armours:16",
|
||||
"name":"Crude leather armour",
|
||||
"name":"Crude leather armor",
|
||||
"hasManualPrice":0,
|
||||
"baseMarketCost":514,
|
||||
"category":"bdy_lthr",
|
||||
@@ -429,7 +429,7 @@
|
||||
{
|
||||
"id":"armour_firm_leather",
|
||||
"iconID":"items_armours:16",
|
||||
"name":"Firm leather armour",
|
||||
"name":"Firm leather armor",
|
||||
"hasManualPrice":0,
|
||||
"baseMarketCost":417,
|
||||
"category":"bdy_lthr",
|
||||
@@ -441,7 +441,7 @@
|
||||
{
|
||||
"id":"armour_rigid_leather",
|
||||
"iconID":"items_armours:16",
|
||||
"name":"Rigid leather armour",
|
||||
"name":"Rigid leather armor",
|
||||
"hasManualPrice":0,
|
||||
"baseMarketCost":625,
|
||||
"category":"bdy_lthr",
|
||||
@@ -493,7 +493,7 @@
|
||||
{
|
||||
"id":"armour_leather_villain",
|
||||
"iconID":"items_armours:16",
|
||||
"name":"Villain's leather armour",
|
||||
"name":"Villain's leather armor",
|
||||
"hasManualPrice":0,
|
||||
"baseMarketCost":3700,
|
||||
"category":"bdy_lthr",
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
{
|
||||
"id":"bwm_leather_armour",
|
||||
"iconID":"items_armours:15",
|
||||
"name":"Blackwater leather armour",
|
||||
"name":"Blackwater leather armor",
|
||||
"displaytype":"rare",
|
||||
"hasManualPrice":1,
|
||||
"baseMarketCost":2551,
|
||||
|
||||
@@ -665,7 +665,7 @@
|
||||
},
|
||||
{
|
||||
"id":"guynmart_reward3",
|
||||
"name":"Armour",
|
||||
"name":"Armor",
|
||||
"iconID":"items_armours:12",
|
||||
"unique":1,
|
||||
"phraseID":"guynmart_reward3_10"
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
フォーラムに来て、他のプレイヤーとAndor\'s Trailの話をしませんか?<br />
|
||||
<a href="http://andorstrail.com/">andorstrail.com に、このゲームに関する質問と議論のためのフォーラム(英語)があります。</a><br />
|
||||
<br />
|
||||
<a href="http://andorstrail.com/wiki">Game wiki for info about the Andor\'s Trail world, among other things.</a><br />
|
||||
<a href="http://docs.andorstrail.com/">Game wiki for info about the Andor\'s Trail world, among other things.</a><br />
|
||||
<br />
|
||||
<a href="http://code.google.com/p/andors-trail/">開発者のためのプロジェクト・ページは code.google.com にあります。</a><br />
|
||||
<br />
|
||||
|
||||
@@ -8,6 +8,16 @@
|
||||
<item>@string/questlog_includecompleted_onlycompleted</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Order is hardcoded within StartScreenActivity_NewGame-->
|
||||
<string-array name="startscreen_mode_selector">
|
||||
<item>@string/startscreen_mode_unlimited_saves_and_lives</item>
|
||||
<item>@string/startscreen_mode_unlimited_lives</item>
|
||||
<item>@string/startscreen_mode_50_lives</item>
|
||||
<item>@string/startscreen_mode_10_lives</item>
|
||||
<item>@string/startscreen_mode_3_lives</item>
|
||||
<item>@string/startscreen_mode_1_life</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Order is hardcoded within HeroInfoActivity_inventory-->
|
||||
<string-array name="inventorylist_category_filters">
|
||||
<item>@string/inventory_category_all</item>
|
||||
@@ -121,6 +131,33 @@
|
||||
<item>2.0f</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="preferences_language">
|
||||
<item>@string/preferences_language_default</item>
|
||||
<item>English</item>
|
||||
<item>Deutsch (93%)</item>
|
||||
<item>Español (93%)</item>
|
||||
<item>Française (59%)</item>
|
||||
<item>Italiano (93%)</item>
|
||||
<item>Magyar (45%)</item>
|
||||
<item>Polski (93%)</item>
|
||||
<item>Português (81%)</item>
|
||||
<item>Português Brasil (85%)</item>
|
||||
<item>Русский язык (93%)</item>
|
||||
</string-array>
|
||||
<string-array name="preferences_language_values">
|
||||
<item>default</item>
|
||||
<item>en</item>
|
||||
<item>de</item>
|
||||
<item>es</item>
|
||||
<item>fr</item>
|
||||
<item>it</item>
|
||||
<item>hu</item>
|
||||
<item>pl</item>
|
||||
<item>pt</item>
|
||||
<item>pt-BR</item>
|
||||
<item>ru</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="preferences_movement_dpad_positions">
|
||||
<item>@string/preferences_movement_dpad_positions_disabled</item>
|
||||
<item>@string/preferences_movement_dpad_positions_lower_right</item>
|
||||
|
||||
@@ -6,82 +6,122 @@
|
||||
<string name="about_copyright">Copyright © 2010–2013 Oskar Wiksten<br />
|
||||
Copyright © 2013–2018 The Andor\'s Trail development team<br />
|
||||
<br /></string>
|
||||
<string name="about_authors">
|
||||
Created & originally programmed by Oskar Wiksten<br />
|
||||
<a href="http://andorstrail.com/">Web site provided by Scott Devaney</a><br />
|
||||
Programming & tools by <a href="https://github.com/Zukero">Kevin Pochat</a><br />
|
||||
Additional maps done by Michael Schmid<br />
|
||||
Additional maps done by Pete Wheeler<br />
|
||||
Additional maps done by Ian Haase<br />
|
||||
Additional programming by Samuel Plentz<br />
|
||||
Additional programming by Uwe Jugel<br />
|
||||
Additional programming by Olivier Samyn<br />
|
||||
Additional programming by Ethan Wessel<br />
|
||||
Additional programming by Scott Lund<br />
|
||||
Additional programming by Lucas Delvallet<br />
|
||||
Additional programming by Florian Doublet<br />
|
||||
Additional programming by M.H. Alkotob<br />
|
||||
Additional programming by Olivier Dragon<br />
|
||||
Additional graphics by Karvis<br />
|
||||
Russian translation by Dreamer..., e.solodookhin, shell.andor, konstmih, istasman, Aleksey Kabanov, Alexander Zubok, Paul Sulemenkov and dromoz<br />
|
||||
Italian translation by k6blue, liogiu, Joker and Andrea Luciano Damico<br />
|
||||
French translation by LeSanglier, Misty Soul, zorun.42, Marwane K. and olivier<br />
|
||||
German translation by Bomber, Samuel Plentz, cngunners14, Phoenixor, Tutar, Mütze, Moerit, Mayweed, Christian Berlage and Firefly84<br />
|
||||
English proofreading by taws34 and Elyon<br />
|
||||
English proofreading and testing by Stephen Stalnaker and <a href="https://urbalazs.hu">Balázs Úr</a><br />
|
||||
Hungarian translation by <a href="https://urbalazs.hu">Balázs Úr</a><br />
|
||||
Hebrew translation by eitanbm<br />
|
||||
Portuguese(PT) translation by mira<br />
|
||||
Portuguese(BR) translation by Mauro Carvalho Chehab, Rafael Mendes (fifa1988)<br />
|
||||
Japanese translation by surgecurrent<br />
|
||||
Polish translation by tobik9090siemens, DanielS and Piotr Wieczorek<br />
|
||||
Spanish translation by pahsito<br />
|
||||
Forum moderated by Tim Davis<br />
|
||||
Forum moderated by Josh Kloos<br />
|
||||
Forum moderated by Travis Miller<br />
|
||||
Forum moderated by Matthew B. White (Nyktos)<br />
|
||||
Forum moderated by Brent May<br />
|
||||
Additional ideas by Nicholas Franks (Taledus)<br />
|
||||
Additional content and ideas by Tom Jobes<br />
|
||||
Additional content and ideas by Stan "Meirerion"<br />
|
||||
Additional content by Richard Jackson (rijackson741)<br />
|
||||
Additional content by <a href="http://gulisanolaw.com">Mike Gulisano</a><br />
|
||||
Additional content by Christian Berlage<br />
|
||||
Additional content by Daniel-Ømicrón Rodríguez García (Omicronrg9)<br />
|
||||
<br />
|
||||
<a href="http://pixeljoint.com/p/101133.htm">Original hero sprites by Maksiu</a><br />
|
||||
<a href="http://redknight91.deviantart.com/art/Arena-Game-Sprites-154661559">Hero graphics by RedKnight91</a><br />
|
||||
<a href="https://opengameart.org/content/ui-pack-0">UI based on graphics by Shadow3097</a><br />
|
||||
<a href="http://www.mansgreback.com">Typography by Måns Grebäck</a><br />
|
||||
<a href="http://telles0808.deviantart.com/art/RPG-Maker-VX-RTP-Tileset-159218223">Map tilesets graphics by telles0808</a><br />
|
||||
<a href="http://ails.deviantart.com/art/420-Pixel-Art-Icons-for-RPG-129892453">Item tilesets graphics by Ails</a><br />
|
||||
<a href="http://nacred.deviantart.com/art/Sprite-Sheet-171751308">Additional monster graphics by nacred</a><br />
|
||||
<a href="http://opengameart.org/content/whispers-of-avalon-item-icons">Additional graphics by Meway, Len Pabin, Auran, Silviyius</a><br />
|
||||
<a href="http://opengameart.org/content/10-basic-rpg-enemies">Additional graphics by Stephen Challener (Redshrike)</a> <a href="http://opengameart.org/content/more-rpg-enemies">(more)</a><br />
|
||||
<a href="http://opengameart.org/content/skull">Additional graphics by Jorge.Avila</a><br />
|
||||
<a href="http://opengameart.org/content/dark-fantasy-item-sprites">Additional graphics by Gwes</a><br />
|
||||
<a href="http://pousse.rapiere.free.fr/tome/">Additional graphics by David Gervais</a><br />
|
||||
<a href="http://forums.wesnoth.org/viewtopic.php?f=19&t=12207&start=75">Additional graphics by turin</a><br />
|
||||
<a href="http://opengameart.org/content/zombies-skeletons">Additional graphics by artisticdude</a><br />
|
||||
<a href="http://pixelhack.blogspot.com/">Additional graphics by Mindflayer / Necroleachate</a><br />
|
||||
<a href="http://opengameart.org/content/items-set">Additional graphics by Artur Reterski</a><br />
|
||||
<a href="http://opengameart.org/content/farming-tilesets-magic-animations-and-ui-elements">Additional graphics by Daniel Eddeland</a><br />
|
||||
<a href="http://opengameart.org/content/liberated-pixel-cup-base-assets-sprites-map-tiles">Additional graphics by Lanea Zimmerman (AKA Sharm)</a><br />
|
||||
<a href="http://art.gnome.org/themes/icon">Additional graphics by Gnome icon artists</a><br />
|
||||
<a href="http://forums.rpgmakerweb.com/index.php?/topic/5434-its-a-mad-mad-mad-mad-world-maddies-edits-and-clumping/">Additional graphics by Paladin-Cleric of Awesome</a><br />
|
||||
<a href="http://ayene-chan.deviantart.com/gallery/32324562">Additional graphics by Ayene-chan</a><br />
|
||||
<a href="http://vxresource.wordpress.com/2010/03/17/the-real-macks-tileset/">Additional graphics by Mack</a><br />
|
||||
<a href="http://forums.rpgmakerweb.com/index.php?/topic/9178-amazing-avys-awesome-arrrpg-maker-stuff/ ">Additional graphics by Avery, Gits</a><br />
|
||||
<a href="http://vxresource.wordpress.com/category/resources/tilesets/">Additional graphics by vxresource.wordpress.com</a><br />
|
||||
This website shares tiles with the general public for free with the agreement of their original creators.<br />
|
||||
<br />
|
||||
Additional graphics by DeBray Bailey<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".
|
||||
<string name="about_authors"><![CDATA[
|
||||
<h4>Created & originally programmed by Oskar Wiksten</h4>
|
||||
<b>Development team</b><br/>
|
||||
Oskar Wiksten<br/>
|
||||
Scott Devaney <b>*</b><br/>
|
||||
<a href="https://github.com/Zukero">Kevin Pochat <b>*</b></a><br/>
|
||||
Ian Haase<br/>
|
||||
<a href="https://github.com/Rijackson">Richard Jackson (rijackson741) <b>*</b></a><br/>
|
||||
Christian Berlage <b>*</b><br/>
|
||||
<a href="http://gulisanolaw.com">Mike Gulisano</a><br/>
|
||||
Christian Zink <b>*</b><br/>
|
||||
<b>*</b> Currently active on team<br/>
|
||||
<br/>
|
||||
<b>Development tools (Andor\'s Trail Content Studio) by</b><br/>
|
||||
<a href="https://github.com/Zukero">Kevin Pochat</a><br/>
|
||||
<br/>
|
||||
<b>Additional programming by</b><br/>
|
||||
Samuel Plentz<br/>
|
||||
Uwe Jugel<br/>
|
||||
Olivier Samyn<br/>
|
||||
Ethan Wessel<br/>
|
||||
Scott Lund<br/>
|
||||
Lucas Delvallet<br/>
|
||||
Florian Doublet<br/>
|
||||
M.H. Alkotob<br/>
|
||||
Olivier Dragon<br/>
|
||||
Christian Zink<br/>
|
||||
Antison<br/>
|
||||
<br/>
|
||||
<b>Additional content created by</b><br/>
|
||||
Tom Jobes<br/>
|
||||
Stan "Meirerion"<br/>
|
||||
Pete Wheeler<br/>
|
||||
Michael Schmid<br/>
|
||||
<a href="https://github.com/Rijackson">Richard Jackson (rijackson741)</a><br/>
|
||||
Ian Haase<br/>
|
||||
<a href="http://gulisanolaw.com">Mike Gulisano</a><br/>
|
||||
Christian Berlage<br/>
|
||||
Daniel-Ømicrón Rodríguez García (Omicronrg9)<br/>
|
||||
Moritz Arendt-Roth (Moerit)<br/>
|
||||
<br/>
|
||||
<b>Translations</b><br/>
|
||||
Russian translation by Dreamer..., e.solodookhin, shell.andor, konstmih, istasman, Aleksey Kabanov, Alexander Zubok, Paul Sulemenkov and dromoz<br/>
|
||||
Italian translation by k6blue, liogiu, Joker and Andrea Luciano Damico<br/>
|
||||
French translation by LeSanglier, Misty Soul, zorun.42, Marwane K. and Olivier<br/>
|
||||
German translation by Bomber, Samuel Plentz, cngunners14, Phoenixor, Tutar, Mütze, Moerit, Mayweed, Christian Berlage and Firefly84<br/>
|
||||
Hungarian translation by <a href="https://urbalazs.hu">Balázs Úr</a><br/>
|
||||
Hebrew translation by eitanbm<br/>
|
||||
Portuguese(PT) translation by mira<br/>
|
||||
Portuguese(BR) translation by Mauro Carvalho Chehab, Rafael Mendes (fifa1988)<br/>
|
||||
Japanese translation by surgecurrent<br/>
|
||||
Polish translation by tobik9090siemens, DanielS and Piotr Wieczorek<br/>
|
||||
Spanish translation by pahsito<br/>
|
||||
<br/>
|
||||
<b>Graphics</b><br/>
|
||||
<a href="http://pixeljoint.com/p/101133.htm">Original hero sprites by Maksiu</a><br/>
|
||||
<a href="http://redknight91.deviantart.com/art/Arena-Game-Sprites-154661559">Hero graphics by RedKnight91</a><br/>
|
||||
<a href="https://opengameart.org/content/ui-pack-0">UI based on graphics by Shadow3097</a><br/>
|
||||
<a href="http://www.mansgreback.com">Typography by Måns Grebäck</a><br>
|
||||
<a href="http://telles0808.deviantart.com/art/RPG-Maker-VX-RTP-Tileset-159218223">Map tilesets graphics by telles0808</a><br/>
|
||||
<a href="http://ails.deviantart.com/art/420-Pixel-Art-Icons-for-RPG-129892453">Item tilesets graphics by Ails</a><br/>
|
||||
<a href="http://nacred.deviantart.com/art/Sprite-Sheet-171751308">Additional monster graphics by nacred</a><br/>
|
||||
<a href="http://opengameart.org/content/whispers-of-avalon-item-icons">Additional graphics by Meway, Len Pabin, Auran, Silviyius</a><br/>
|
||||
<a href="http://opengameart.org/content/10-basic-rpg-enemies">Additional graphics by Stephen Challener (Redshrike)</a> <a href="http://opengameart.org/content/more-rpg-enemies">(more)</a><br/>
|
||||
<a href="http://opengameart.org/content/skull">Additional graphics by Jorge.Avila</a><br/>
|
||||
<a href="http://opengameart.org/content/dark-fantasy-item-sprites">Additional graphics by Gwes</a><br/>
|
||||
<a href="http://pousse.rapiere.free.fr/tome/">Additional graphics by David Gervais</a><br/>
|
||||
<a href="http://forums.wesnoth.org/viewtopic.php?f=19&t=12207&start=75">Additional graphics by turin</a><br/>
|
||||
<a href="http://opengameart.org/content/zombies-skeletons">Additional graphics by artisticdude</a><br/>
|
||||
<a href="http://pixelhack.blogspot.com/">Additional graphics by Mindflayer / Necroleachate</a><br/>
|
||||
<a href="http://opengameart.org/content/items-set">Additional graphics by Artur Reterski</a><br/>
|
||||
<a href="http://opengameart.org/content/farming-tilesets-magic-animations-and-ui-elements">Additional graphics by Daniel Eddeland</a><br/>
|
||||
<a href="http://opengameart.org/content/liberated-pixel-cup-base-assets-sprites-map-tiles">Additional graphics by Lanea Zimmerman (AKA Sharm)</a><br/>
|
||||
<a href="http://art.gnome.org/themes/icon">Additional graphics by Gnome icon artists</a><br/>
|
||||
<a href="http://forums.rpgmakerweb.com/index.php?/topic/5434-its-a-mad-mad-mad-mad-world-maddies-edits-and-clumping/">Additional graphics by Paladin-Cleric of Awesome</a><br/>
|
||||
<a href="http://ayene-chan.deviantart.com/gallery/32324562">Additional graphics by Ayene-chan</a><br/>
|
||||
<a href="http://vxresource.wordpress.com/2010/03/17/the-real-macks-tileset/">Additional graphics by Mack</a><br/>
|
||||
<a href="http://forums.rpgmakerweb.com/index.php?/topic/9178-amazing-avys-awesome-arrrpg-maker-stuff/ ">Additional graphics by Avery, Gits</a><br/>
|
||||
<a href="http://vxresource.wordpress.com/category/resources/tilesets/">Additional graphics by vxresource.wordpress.com</a>. This website shares tiles with the general public for free with the agreement of their original creators.<br/>
|
||||
<a href="http://fatboy73.deviantart.com">;Additional graphics by Chris Hall (Fatboy73)</a><br/>
|
||||
Additional graphics by DeBray Bailey<br/>
|
||||
Additional graphics by Karvis<br/>
|
||||
<a href="http://rltiles.sourceforge.net">Monster tileset graphics by rltiles.sourceforge.net</a><br/>
|
||||
Part (or All) of 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 <a href="http://rltiles.sf.net">http://rltiles.sf.net</a><br />
|
||||
<br />
|
||||
Some of the graphic data in this software are free game resources distributed by REFMAP (<a href="http://www.tekepon.net/fsm">http://www.tekepon.net/fsm</a>).
|
||||
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.<br />
|
||||
You can find the original tileset at <a href="http://rltiles.sf.net">http://rltiles.sf.net</a><br/>
|
||||
<br/>
|
||||
Some of the graphic data in this software are free game resources distributed by REFMAP (<a href="http://www.tekepon.net/fsm">http://www.tekepon.net/fsm</a>).
|
||||
You must not use the graphic data which is in this software, for any purpose except playing this game. When you want to get these resources, go to the website above.<br/>
|
||||
<br/>
|
||||
<b>English proof reading and correction by</b><br/>
|
||||
taws34<br/>
|
||||
Elyon<br/>
|
||||
Stephen Stalnaker<br/>
|
||||
<a href="https://github.com/Rijackson">Richard Jackson (rijackson741)</a><br/>
|
||||
Antison<br/>
|
||||
<a href="https://urbalazs.hu">Balázs Úr</a><br/>
|
||||
<br/>
|
||||
<b>Testing, feedback, & ideas by</b><br/>
|
||||
Stephen Stalnaker<br/>
|
||||
Antison<br/>
|
||||
<a href="https://urbalazs.hu">Balázs Úr</a><br/>
|
||||
Nicholas Franks (Taledus)<br/>
|
||||
<br/>
|
||||
<b><a href="http://andorstrail.com/">Website</a>, <a href="https://discord.gg/FgwXdy6">Discord</a>, and developer Slack channels maintained by</b><br/>
|
||||
Scott Devaney<br/>
|
||||
<br/>
|
||||
<b>Forum administrators and moderators</b><br/>
|
||||
Tim Davis<br/>
|
||||
Josh Kloos<br/>
|
||||
Travis Miller<br/>
|
||||
Matthew B. White (Nyktos)<br/>
|
||||
Brent May<br/>
|
||||
<br/>
|
||||
<b><a href="https://andorstrail.com/viewtopic.php?f=6&t=4560">Want to see yourself on this page? Visit our contribution guide!</a></b><br/>
|
||||
<br/>
|
||||
]]>
|
||||
</string>
|
||||
</resources>
|
||||
</resources>
|
||||
@@ -19,11 +19,16 @@
|
||||
<string name="dialog_loading_failed_title">Load Failed</string>
|
||||
<string name="dialog_loading_failed_message">Andor\'s Trail was unable to load the savegame file.\n\n:(\n\nThe file may be damaged or incomplete.</string>
|
||||
<string name="dialog_loading_failed_incorrectversion">Andor\'s Trail was unable to load the savegame file. This savegame file is created with a newer version than what is currently running.</string>
|
||||
<string name="dialog_loading_failed_cheat">Andor\'s Trail was unable to load the savegame file. This savegame file has already been continued.</string>
|
||||
|
||||
<string name="dialog_recenter">Recenter</string>
|
||||
<string name="dialog_close">Close</string>
|
||||
<string name="dialog_more">More</string>
|
||||
|
||||
<string name="dialog_game_over_title">Game over</string>
|
||||
<string name="dialog_game_over_text">You take your last breath and die.</string>
|
||||
<string name="rip_startscreen">(RIP)</string>
|
||||
|
||||
<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>
|
||||
@@ -40,7 +45,8 @@
|
||||
<string name="heroinfo_skill_sort">Sort</string>
|
||||
<string name="heroinfo_levelup">Level up</string>
|
||||
<string name="heroinfo_level">Level</string>
|
||||
<string name="heroinfo_totalexperience">Total experience</string>
|
||||
<string name="heroinfo_mode">Mode</string>
|
||||
<string name="heroinfo_totalexperience">Total experience</string>
|
||||
<string name="heroinfo_wornequipment">Worn equipment</string>
|
||||
<string name="heroinfo_inventory">Inventory</string>
|
||||
<string name="heroinfo_inventory_categories">Category</string>
|
||||
@@ -51,6 +57,11 @@
|
||||
<string name="heroinfo_actionpoints">Action points (AP):</string>
|
||||
<string name="heroinfo_quests">Quests</string>
|
||||
|
||||
<string name="heroinfo_unlimited_lives_and_saves">Standard\n(Unlimited lives and saves)</string>
|
||||
<string name="heroinfo_unlimited_lives">Unlimited lives, 1 save</string>
|
||||
<string name="heroinfo_limited_lives">Limited lives (%1$d/%2$d left)</string>
|
||||
<string name="heroinfo_one_life">Permadeath (1 life)</string>
|
||||
|
||||
<string name="combat_attack">Attack (%1$d AP)</string>
|
||||
<string name="combat_move">Move (%1$d AP)</string>
|
||||
<string name="combat_use">Use item</string>
|
||||
@@ -143,6 +154,19 @@
|
||||
<string name="startscreen_selectherosprite">Choose your hero</string>
|
||||
<string name="startscreen_enterheroname">Enter hero name</string>
|
||||
<string name="startscreen_load">Load</string>
|
||||
<string name="startscreen_game_mode">Mode</string>
|
||||
<string name="startscreen_load_game">Load game</string>
|
||||
<string name="startscreen_load_game_confirm">The current game is unsaved and you will lose your character.</string>
|
||||
<string name="startscreen_error_loading_game">Error loading game</string>
|
||||
<string name="startscreen_error_loading_empty_slot">Can\'t load from an empty slot.</string>
|
||||
<string name="startscreen_attention_slot_gets_delete_on_load">Attention</string>
|
||||
<string name="startscreen_attention_message_slot_gets_delete_on_load">Loading this game deletes its save slot. You will have to save again before switching to another game.</string>
|
||||
<string name="startscreen_mode_unlimited_saves_and_lives">Standard (Unlimited lives and saves)</string>
|
||||
<string name="startscreen_mode_unlimited_lives">Medium (Unlimited lives, 1 save)</string>
|
||||
<string name="startscreen_mode_50_lives">Hard (50 lives, 1 save)</string>
|
||||
<string name="startscreen_mode_10_lives">Very hard (10 lives, 1 save)</string>
|
||||
<string name="startscreen_mode_3_lives">Extreme (3 lives, 1 save)</string>
|
||||
<string name="startscreen_mode_1_life">Permadeath (1 life, 1 save)</string>
|
||||
|
||||
<!-- <string name="conversation_title">%1$s says</string> -->
|
||||
<string name="conversation_rewardexp"> [You gained %1$d experience]</string>
|
||||
@@ -187,7 +211,7 @@
|
||||
<br />
|
||||
<a href="http://andorstrail.com/">Game forums on andorstrail.com for questions and gameplay discussions.</a><br />
|
||||
<br />
|
||||
<a href="http://andorstrail.com/wiki">Game wiki for info about the Andor\'s Trail world, among other things.</a><br />
|
||||
<a href="http://docs.andorstrail.com/">Game wiki for info about the Andor\'s Trail world, among other things.</a><br />
|
||||
<br />
|
||||
<a href="https://github.com/Zukero/andors-trail/">Project source code on github.com for developers.</a><br />
|
||||
<br />
|
||||
@@ -345,6 +369,10 @@
|
||||
<string name="preferences_display_scaling_factor_50_percent_larger">1.5x size</string>
|
||||
<string name="preferences_display_scaling_factor_double">Double size</string>
|
||||
|
||||
<string name="preferences_language_default">System language</string>
|
||||
<string name="preferences_language">Language</string>
|
||||
<string name="preferences_language_description">Select the language. English is used if the system language is not available or content has not ben translated. (Requires restart)</string>
|
||||
|
||||
<string name="inventory_assign">Assign quick slot</string>
|
||||
<string name="inventory_selectitem">Select item to assign</string>
|
||||
<string name="inventory_assign_slot1">Slot 1</string>
|
||||
@@ -448,10 +476,10 @@
|
||||
<string name="skill_prerequisite_other_skill">To level up this skill, you need at least level %1$d of the %2$s skill.</string>
|
||||
<string name="skill_prerequisite_level">To level up this skill, you need at least experience level %1$d.</string>
|
||||
<string name="skill_prerequisite_stat">To level up this skill, you need at least %1$d %2$s (base stats).</string>
|
||||
<string name="skill_number_of_increases_one">You may select one skill to improve.</string>
|
||||
<string name="skill_number_of_increases_several">You may select %1$d skills to improve.</string>
|
||||
<string name="levelup_adds_new_skillpoint">This level also gives you a new skill point to spend!</string>
|
||||
|
||||
<string name="skill_number_of_increases_one">You may select one skill to improve.</string>
|
||||
<string name="skill_number_of_increases_several">You may select %1$d skills to improve.</string>
|
||||
<string name="levelup_adds_new_skillpoint">This level also gives you a new skill point to spend!</string>
|
||||
|
||||
<string name="loadsave_save_to_new_slot">Create new savegame slot</string>
|
||||
<string name="loadsave_save_overwrite_confirmation_title">Overwrite savegame?</string>
|
||||
<string name="loadsave_save_overwrite_confirmation">This savegame contains a different player name (%1$s) than your current player name (%2$s). Are you sure you want to overwrite this savegame?</string>
|
||||
@@ -470,7 +498,9 @@
|
||||
|
||||
<string name="traitsinfo_base_max_hp">Max HP:</string>
|
||||
<string name="traitsinfo_base_max_ap">Max AP:</string>
|
||||
<string name="menu_save_saving_not_allowed_in_combat">Cannot save the game while in combat.</string>
|
||||
<string name="menu_save_saving_not_allowed_in_combat">Cannot save the game while in combat.</string>
|
||||
<string name="menu_save_switch_character_title">Switch character</string>
|
||||
<string name="menu_save_switch_character">Saving allows you to switch to another character and later continue the current game. Do you want to save and exit the current game?</string>
|
||||
|
||||
<string name="preferences_optimized_drawing_title">Optimized drawing</string>
|
||||
<string name="preferences_optimized_drawing">Disable this if you see graphical artifacts. Enabling this option will make the game only redraw changed parts of the screen every frame.</string>
|
||||
@@ -548,6 +578,8 @@
|
||||
|
||||
<string name="loadsave_save_overwrite_confirmation_all">Are you sure you want to overwrite this savegame?</string>
|
||||
<string name="loadsave_save_overwrite_confirmation_slot">(slot %1$d)</string>
|
||||
<string name="loadsave_empty_slot">%1$d.<empty></string>
|
||||
|
||||
<string name="preferences_display_overwrite_savegame_entries_always_confirm">Always show confirmation dialog box</string>
|
||||
<string name="preferences_display_overwrite_savegame_entries_confirm_overwrite">Only show when overwriting a different playername</string>
|
||||
<string name="preferences_display_overwrite_savegame_entries_never_confirm">Never display confirmation dialog box</string>
|
||||
@@ -582,6 +614,7 @@
|
||||
<string name="skill_title_specialization_dualwield">Specialization: Dual wield</string>
|
||||
<string name="skill_title_specialization_2hand">Specialization: Two-handed weapon</string>
|
||||
<string name="skill_title_specialization_weapon_shield">Specialization: Weapon and shield</string>
|
||||
<string name="skill_title_weapon_prof_pole">Pole weapon proficiency</string>
|
||||
|
||||
<string name="skill_shortdescription_weapon_prof_dagger">Better at fighting with daggers</string>
|
||||
<string name="skill_shortdescription_weapon_prof_1hsword">Better at fighting with one-handed swords</string>
|
||||
@@ -599,12 +632,13 @@
|
||||
<string name="skill_shortdescription_specialization_dualwield">Expert at dual wielding</string>
|
||||
<string name="skill_shortdescription_specialization_2hand">Expert at two-handed weapons</string>
|
||||
<string name="skill_shortdescription_specialization_weapon_shield">Expert at fighting with weapon and shield</string>
|
||||
<string name="skill_shortdescription_weapon_prof_pole">Better at fighting with pole weapons</string>
|
||||
|
||||
<string name="skill_longdescription_weapon_prof_dagger">For each skill level, increases attack chance when using daggers and shortswords by %1$d %% of the item\'s base attack chance, increases block chance by %2$d %% of the item\'s base block chance, and increases critical skill by %3$d %% of the item\'s base critical skill.</string>
|
||||
<string name="skill_longdescription_weapon_prof_1hsword">For each skill level, increases attack chance of rapiers, longswords and broadswords by %1$d %% of the item\'s base attack chance, increases block chance by %2$d %% of the item\'s base block chance, and increases critical skill by %3$d %% of the item\'s base critical skill.</string>
|
||||
<string name="skill_longdescription_weapon_prof_2hsword">For each skill level, increases attack chance of two-handed swords by %1$d %% of the item\'s base attack chance, increases block chance by %2$d %% of the item\'s base block chance, and increases critical skill by %3$d %% of the item\'s base critical skill.</string>
|
||||
<string name="skill_longdescription_weapon_prof_axe">For each skill level, increases attack chance of axes and greataxes by %1$d %% of the item\'s base attack chance, increases block chance by %2$d %% of the item\'s base block chance, and increases critical skill by %3$d %% of the item\'s base critical skill.</string>
|
||||
<string name="skill_longdescription_weapon_prof_blunt">For each skill level, increases attack chance of bludgeoning weapons by %1$d %% of the item\'s base attack chance, increases block chance by %2$d %% of the item\'s base block chance, and increases critical skill by %3$d %% of the item\'s base critical skill. This includes clubs, quarterstaves, maces, scepters, war hammers and giant hammers.</string>
|
||||
<string name="skill_longdescription_weapon_prof_blunt">For each skill level, increases attack chance of bludgeoning weapons by %1$d %% of the item\'s base attack chance, increases block chance by %2$d %% of the item\'s base block chance, and increases critical skill by %3$d %% of the item\'s base critical skill. This includes clubs, quarterstaves, maces, scepters, war hammers and giant hammers.</string>
|
||||
<string name="skill_longdescription_weapon_prof_unarmed">When fighting without a weapon and shield, gain %1$d attack chance, %2$d damage potential and %3$d block chance per skill level.</string>
|
||||
<string name="skill_longdescription_armor_prof_shield">Increase damage resistance by %1$d per skill level while having a shield equipped.</string>
|
||||
<string name="skill_longdescription_armor_prof_unarmored">While fighting without having any piece of armor equipped, gain %1$d block chance per skill level. Items made of cloth are not considered as being armor.</string>
|
||||
@@ -626,6 +660,7 @@ Every skill level increases the attack chance of weapons with %1$d %% of their o
|
||||
<string name="skill_longdescription_specialization_dualwield">Increases the attack chance of both wielded weapons by an additional %1$d %% of their original attack chances, in addition to the benefits given by the weapon style skill. The block chances of both wielded weapons are also increased by %2$d %% of their original block chances.</string>
|
||||
<string name="skill_longdescription_specialization_2hand">Increases damage potential of two-handed weapons by an additional %1$d %% of the original damage potential, in addition to the benefits given by the weapon style skill. The attack chances of two-handed weapons are also increased by %2$d %% of their original attack chances.</string>
|
||||
<string name="skill_longdescription_specialization_weapon_shield">Increases both attack chances and damage potential of weapons. The attack chance is increased by %1$d %% of the original attack chance, and the damage potential is increased by %2$d %% of the original damage potential.</string>
|
||||
<string name="skill_longdescription_weapon_prof_pole">For each skill level, increases attack chance when using pole weapons by %1$d %% of the item\'s base attack chance, increases block chance by %2$d %% of the item\'s base block chance, and increases critical skill by %3$d %% of the item\'s base critical skill.</string>
|
||||
|
||||
<string name="preferences_quickslots_placement">Quickslot position</string>
|
||||
<string name="preferences_quickslots_placement_summary">Where to place the quickslots</string>
|
||||
|
||||
@@ -110,10 +110,12 @@
|
||||
android:defaultValue="false"
|
||||
android:summary="@string/preferences_ui_show_quickslots_when_toolbox_is_visible"
|
||||
android:key="showQuickslotsWhenToolboxIsVisible" />
|
||||
<CheckBoxPreference
|
||||
android:title="@string/preferences_ui_use_localized_resources_title"
|
||||
android:defaultValue="true"
|
||||
android:summary="@string/preferences_ui_use_localized_resources"
|
||||
android:key="useLocalizedResources" />
|
||||
<com.gpl.rpg.AndorsTrail.view.CustomListPreference
|
||||
android:title="@string/preferences_language"
|
||||
android:summary="@string/preferences_language_description"
|
||||
android:key="language"
|
||||
android:defaultValue="default"
|
||||
android:entries="@array/preferences_language"
|
||||
android:entryValues="@array/preferences_language_values" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Locale;
|
||||
import com.gpl.rpg.AndorsTrail.context.ControllerContext;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.controller.Constants;
|
||||
import com.gpl.rpg.AndorsTrail.util.Pair;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
@@ -23,13 +24,14 @@ public final class AndorsTrailApplication extends Application {
|
||||
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 = false;
|
||||
public static final boolean DEVELOPMENT_DEBUGBUTTONS = true;
|
||||
public static final boolean DEVELOPMENT_FASTSPEED = false;
|
||||
public static final boolean DEVELOPMENT_VALIDATEDATA = false;
|
||||
public static final boolean DEVELOPMENT_DEBUGMESSAGES = false;
|
||||
public static final boolean DEVELOPMENT_INCOMPATIBLE_SAVEGAMES = DEVELOPMENT_DEBUGRESOURCES || DEVELOPMENT_DEBUGBUTTONS || DEVELOPMENT_FASTSPEED;
|
||||
public static final int CURRENT_VERSION = DEVELOPMENT_INCOMPATIBLE_SAVEGAMES ? 999 : 48;
|
||||
public static final String CURRENT_VERSION_DISPLAY = "0.7.7";
|
||||
public static final int DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION = 999;
|
||||
public static final int CURRENT_VERSION = DEVELOPMENT_INCOMPATIBLE_SAVEGAMES ? DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION : 49;
|
||||
public static final String CURRENT_VERSION_DISPLAY = "0.7.8dev";
|
||||
public static final boolean IS_RELEASE_VERSION = !CURRENT_VERSION_DISPLAY.matches(".*[a-d].*");
|
||||
|
||||
private final AndorsTrailPreferences preferences = new AndorsTrailPreferences();
|
||||
@@ -60,18 +62,32 @@ public final class AndorsTrailApplication extends Application {
|
||||
} else {
|
||||
activity.getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
setLocale(activity);
|
||||
}
|
||||
|
||||
//Get default locale at startup, as somehow it seems that changing the app's
|
||||
//configured locale impacts the value returned by Locale.getDefault() nowadays.
|
||||
private final Locale defaultLocale = Locale.getDefault();
|
||||
|
||||
|
||||
private Pair<String, Locale> lastLocale = null;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public boolean setLocale(Activity context) {
|
||||
Resources res = context.getResources();
|
||||
Configuration conf = res.getConfiguration();
|
||||
final Locale targetLocale = preferences.useLocalizedResources ? defaultLocale : Locale.US;
|
||||
|
||||
Locale targetLocale;
|
||||
|
||||
if (lastLocale != null && lastLocale.first == preferences.language) {
|
||||
targetLocale = lastLocale.second;
|
||||
} else {
|
||||
if (preferences.language.equalsIgnoreCase("default")) {
|
||||
targetLocale = defaultLocale;
|
||||
} else {
|
||||
targetLocale = Locale.forLanguageTag(preferences.language);
|
||||
}
|
||||
lastLocale = new Pair<String, Locale>(preferences.language, targetLocale);
|
||||
}
|
||||
|
||||
if (targetLocale.equals(conf.locale)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,8 @@ public final class AndorsTrailPreferences {
|
||||
public int displayOverwriteSavegame = CONFIRM_OVERWRITE_SAVEGAME_ALWAYS;
|
||||
public int quickslotsPosition = QUICKSLOTS_POSITION_HORIZONTAL_CENTER_BOTTOM;
|
||||
public boolean showQuickslotsWhenToolboxIsVisible = false;
|
||||
public boolean useLocalizedResources = true;
|
||||
public String language = "default";
|
||||
|
||||
public int selectedTheme = 0;
|
||||
|
||||
public void read(final Context androidContext) {
|
||||
@@ -77,7 +78,7 @@ public final class AndorsTrailPreferences {
|
||||
dest.displayOverwriteSavegame = Integer.parseInt(prefs.getString("display_overwrite_savegame", Integer.toString(CONFIRM_OVERWRITE_SAVEGAME_ALWAYS)));
|
||||
dest.quickslotsPosition = Integer.parseInt(prefs.getString("quickslots_placement", Integer.toString(QUICKSLOTS_POSITION_HORIZONTAL_CENTER_BOTTOM)));
|
||||
dest.showQuickslotsWhenToolboxIsVisible = prefs.getBoolean("showQuickslotsWhenToolboxIsVisible", false);
|
||||
dest.useLocalizedResources = prefs.getBoolean("useLocalizedResources", true);
|
||||
dest.language = prefs.getString("language", "default");
|
||||
dest.selectedTheme = Integer.parseInt(prefs.getString("selectedTheme", Integer.toString(0)));
|
||||
// This might be implemented as a skill in the future.
|
||||
//dest.movementAggressiveness = Integer.parseInt(prefs.getString("movementaggressiveness", Integer.toString(MOVEMENTAGGRESSIVENESS_NORMAL)));
|
||||
@@ -98,7 +99,7 @@ public final class AndorsTrailPreferences {
|
||||
dest.displayOverwriteSavegame = CONFIRM_OVERWRITE_SAVEGAME_ALWAYS;
|
||||
dest.quickslotsPosition = QUICKSLOTS_POSITION_HORIZONTAL_CENTER_BOTTOM;
|
||||
dest.showQuickslotsWhenToolboxIsVisible = false;
|
||||
dest.useLocalizedResources = true;
|
||||
dest.language = "default";
|
||||
dest.selectedTheme = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,6 +244,25 @@ public final class Dialogs {
|
||||
});
|
||||
}
|
||||
|
||||
public static void showHeroDied(final MainActivity mainActivity, final ControllerContext controllers) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(mainActivity,
|
||||
mainActivity.getResources().getString(R.string.dialog_game_over_title),
|
||||
mainActivity.getResources().getDrawable(R.drawable.ui_icon_combat),
|
||||
mainActivity.getResources().getString(R.string.dialog_game_over_text),
|
||||
null,
|
||||
true);
|
||||
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.ok);
|
||||
|
||||
showDialogAndPause(d, controllers, new OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface arg0) {
|
||||
mainActivity.finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static Intent getIntentForItemInfo(final Context ctx, String itemTypeID, ItemInfoActivity.ItemInfoAction actionType, String buttonText, boolean buttonEnabled, Inventory.WearSlot inventorySlot) {
|
||||
Intent intent = new Intent(ctx, ItemInfoActivity.class);
|
||||
intent.putExtra("buttonText", buttonText);
|
||||
@@ -324,11 +343,33 @@ public final class Dialogs {
|
||||
Toast.makeText(mainActivity, R.string.menu_save_saving_not_allowed_in_combat, Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
controllerContext.gameRoundController.pause();
|
||||
Intent intent = new Intent(mainActivity, LoadSaveActivity.class);
|
||||
intent.setData(Uri.parse("content://com.gpl.rpg.AndorsTrail/save"));
|
||||
mainActivity.startActivityForResult(intent, MainActivity.INTENTREQUEST_SAVEGAME);
|
||||
return true;
|
||||
|
||||
if (!world.model.statistics.hasUnlimitedSaves()) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(mainActivity,
|
||||
mainActivity.getResources().getString(R.string.menu_save_switch_character_title),
|
||||
null,
|
||||
mainActivity.getResources().getString(R.string.menu_save_switch_character),
|
||||
null,
|
||||
true);
|
||||
CustomDialogFactory.addButton(d, android.R.string.ok, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
controllerContext.gameRoundController.pause();
|
||||
Intent intent = new Intent(mainActivity, LoadSaveActivity.class);
|
||||
intent.setData(Uri.parse("content://com.gpl.rpg.AndorsTrail/save"));
|
||||
mainActivity.startActivityForResult(intent, MainActivity.INTENTREQUEST_SAVEGAME);
|
||||
}
|
||||
});
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.cancel);
|
||||
CustomDialogFactory.show(d);
|
||||
return false;
|
||||
} else {
|
||||
controllerContext.gameRoundController.pause();
|
||||
Intent intent = new Intent(mainActivity, LoadSaveActivity.class);
|
||||
intent.setData(Uri.parse("content://com.gpl.rpg.AndorsTrail/save"));
|
||||
mainActivity.startActivityForResult(intent, MainActivity.INTENTREQUEST_SAVEGAME);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void showLoad(final Activity currentActivity) {
|
||||
|
||||
@@ -28,6 +28,8 @@ public final class WorldSetup {
|
||||
public boolean isSceneReady = false;
|
||||
public String newHeroName;
|
||||
public int newHeroIcon;
|
||||
public int newHeroStartLives;
|
||||
public boolean newHeroUnlimitedSaves;
|
||||
private Savegames.LoadSavegameResult loadResult;
|
||||
|
||||
public WorldSetup(WorldContext world, ControllerContext controllers, Context androidContext) {
|
||||
@@ -149,7 +151,7 @@ public final class WorldSetup {
|
||||
|
||||
private void createNewWorld() {
|
||||
Context ctx = androidContext.get();
|
||||
world.model = new ModelContainer();
|
||||
world.model = new ModelContainer(newHeroStartLives, newHeroUnlimitedSaves);
|
||||
world.model.player.initializeNewPlayer(world.dropLists, newHeroName, newHeroIcon);
|
||||
|
||||
controllers.actorStatsController.recalculatePlayerStats(world.model.player);
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public final class AboutActivity extends Activity implements ImageGetter {
|
||||
public final class AboutActivity extends AndorsTrailBaseActivity implements ImageGetter {
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.AbilityModifierInfoView;
|
||||
import com.gpl.rpg.AndorsTrail.view.ItemEffectsView_OnUse;
|
||||
|
||||
public final class ActorConditionInfoActivity extends Activity {
|
||||
public final class ActorConditionInfoActivity extends AndorsTrailBaseActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
|
||||
public abstract class AndorsTrailBaseActivity extends Activity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(this);
|
||||
app.setLocale(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(this);
|
||||
app.setLocale(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public abstract class AndorsTrailBaseFragmentActivity extends FragmentActivity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(this);
|
||||
app.setLocale(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(this);
|
||||
app.setLocale(this);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
* @author ejwessel
|
||||
* Creates the BulkSelectionInterface dialog that allows for buy/drop/selling
|
||||
*/
|
||||
public final class BulkSelectionInterface extends Activity implements TextWatcher {
|
||||
public final class BulkSelectionInterface extends AndorsTrailBaseActivity implements TextWatcher {
|
||||
|
||||
// class variables
|
||||
public static enum BulkInterfaceType {
|
||||
|
||||
@@ -46,7 +46,7 @@ import com.gpl.rpg.AndorsTrail.resource.tiles.TileManager;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public final class ConversationActivity
|
||||
extends Activity
|
||||
extends AndorsTrailBaseActivity
|
||||
implements OnKeyListener
|
||||
, ConversationController.ConversationStatemachine.ConversationStateListener {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
@@ -24,7 +24,7 @@ import android.webkit.WebViewClient;
|
||||
import android.widget.Button;
|
||||
import android.widget.Toast;
|
||||
|
||||
public final class DisplayWorldMapActivity extends Activity {
|
||||
public final class DisplayWorldMapActivity extends AndorsTrailBaseActivity {
|
||||
private WorldContext world;
|
||||
|
||||
private WebView displayworldmap_webview;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
@@ -18,7 +19,7 @@ import com.gpl.rpg.AndorsTrail.activity.fragment.HeroinfoActivity_Stats;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public final class HeroinfoActivity extends FragmentActivity {
|
||||
public final class HeroinfoActivity extends AndorsTrailBaseFragmentActivity {
|
||||
private WorldContext world;
|
||||
|
||||
private FragmentTabHost tabHost;
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.gpl.rpg.AndorsTrail.model.item.ItemType;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.ItemEffectsView;
|
||||
|
||||
public final class ItemInfoActivity extends Activity {
|
||||
public final class ItemInfoActivity extends AndorsTrailBaseActivity {
|
||||
|
||||
public static enum ItemInfoAction {
|
||||
none, use, equip, unequip, buy, sell
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.gpl.rpg.AndorsTrail.controller.Constants;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Player;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public final class LevelUpActivity extends Activity {
|
||||
public final class LevelUpActivity extends AndorsTrailBaseActivity {
|
||||
private WorldContext world;
|
||||
private ControllerContext controllers;
|
||||
private Player player;
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.gpl.rpg.AndorsTrail.savegames.Savegames.FileHeader;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
|
||||
public final class LoadSaveActivity extends Activity implements OnClickListener {
|
||||
public final class LoadSaveActivity extends AndorsTrailBaseActivity implements OnClickListener {
|
||||
private boolean isLoading = true;
|
||||
private static final int SLOT_NUMBER_CREATE_NEW_SLOT = -1;
|
||||
private static final int SLOT_NUMBER_FIRST_SLOT = 1;
|
||||
@@ -108,10 +108,23 @@ public final class LoadSaveActivity extends Activity implements OnClickListener
|
||||
}
|
||||
|
||||
private void addSavegameSlotButtons(ViewGroup parent, LayoutParams params, List<Integer> usedSavegameSlots) {
|
||||
int unused = 1;
|
||||
for (int slot : usedSavegameSlots) {
|
||||
final FileHeader header = Savegames.quickload(this, slot);
|
||||
if (header == null) continue;
|
||||
|
||||
while (unused < slot){
|
||||
Button b = new Button(this);
|
||||
b.setLayoutParams(params);
|
||||
b.setTag(unused);
|
||||
b.setOnClickListener(this);
|
||||
b.setText(getString(R.string.loadsave_empty_slot, unused));
|
||||
tileManager.setImageViewTileForPlayer(getResources(), b, header.iconID);
|
||||
parent.addView(b, params);
|
||||
unused++;
|
||||
}
|
||||
unused++;
|
||||
|
||||
Button b = new Button(this);
|
||||
b.setLayoutParams(params);
|
||||
b.setTag(slot);
|
||||
@@ -139,6 +152,7 @@ public final class LoadSaveActivity extends Activity implements OnClickListener
|
||||
private String getConfirmOverwriteQuestion(int slot) {
|
||||
if (isLoading) return null;
|
||||
if (slot == SLOT_NUMBER_CREATE_NEW_SLOT) return null; // if we're creating a new slot
|
||||
if (!Savegames.getSlotFile(slot).exists()) return null;
|
||||
|
||||
if (preferences.displayOverwriteSavegame == AndorsTrailPreferences.CONFIRM_OVERWRITE_SAVEGAME_ALWAYS) {
|
||||
return getString(R.string.loadsave_save_overwrite_confirmation_all);
|
||||
@@ -160,42 +174,89 @@ public final class LoadSaveActivity extends Activity implements OnClickListener
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
final int slot = (Integer) view.getTag();
|
||||
final String message = getConfirmOverwriteQuestion(slot);
|
||||
|
||||
if (message != null) {
|
||||
final String title =
|
||||
getString(R.string.loadsave_save_overwrite_confirmation_title) + ' '
|
||||
+ getString(R.string.loadsave_save_overwrite_confirmation_slot, slot);
|
||||
// new AlertDialog.Builder(this)
|
||||
// .setIcon(android.R.drawable.ic_dialog_alert)
|
||||
// .setTitle(title)
|
||||
// .setMessage(message)
|
||||
// .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(DialogInterface dialog, int which) {
|
||||
// loadsave(slot);
|
||||
// }
|
||||
// })
|
||||
// .setNegativeButton(android.R.string.no, null)
|
||||
// .show();
|
||||
final Dialog d = CustomDialogFactory.createDialog(this,
|
||||
title,
|
||||
getResources().getDrawable(android.R.drawable.ic_dialog_alert),
|
||||
message,
|
||||
null,
|
||||
true);
|
||||
|
||||
CustomDialogFactory.addButton(d, android.R.string.yes, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
loadsave(slot);
|
||||
}
|
||||
});
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.no);
|
||||
|
||||
CustomDialogFactory.show(d);
|
||||
if (!isLoading && slot != SLOT_NUMBER_CREATE_NEW_SLOT && AndorsTrailApplication.CURRENT_VERSION == AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION) {
|
||||
final FileHeader header = Savegames.quickload(this, slot);
|
||||
if (header != null && header.fileversion != AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(this,
|
||||
"Overwriting not allowed",
|
||||
getResources().getDrawable(android.R.drawable.ic_dialog_alert),
|
||||
"You are currently using a development version of Andor's trail. Overwriting a regular savegame is not allowed in development mode.",
|
||||
null,
|
||||
true);
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.ok);
|
||||
CustomDialogFactory.show(d);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isLoading) {
|
||||
if(!Savegames.getSlotFile(slot).exists()) {
|
||||
showErrorLoadingEmptySlot();
|
||||
} else {
|
||||
final FileHeader header = Savegames.quickload(this, slot);
|
||||
if (header != null && !header.hasUnlimitedSaves) {
|
||||
showSlotGetsDeletedOnLoadWarning(slot);
|
||||
} else {
|
||||
loadsave(slot);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
loadsave(slot);
|
||||
final String message = getConfirmOverwriteQuestion(slot);
|
||||
if (message != null) {
|
||||
showConfirmoverwriteQuestion(slot, message);
|
||||
} else {
|
||||
loadsave(slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void showErrorLoadingEmptySlot() {
|
||||
final Dialog d = CustomDialogFactory.createDialog(this,
|
||||
getString(R.string.startscreen_error_loading_game),
|
||||
getResources().getDrawable(android.R.drawable.ic_dialog_alert),
|
||||
getString(R.string.startscreen_error_loading_empty_slot),
|
||||
null,
|
||||
true);
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.ok);
|
||||
CustomDialogFactory.show(d);
|
||||
}
|
||||
|
||||
private void showSlotGetsDeletedOnLoadWarning(final int slot) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(this,
|
||||
getString(R.string.startscreen_attention_slot_gets_delete_on_load),
|
||||
getResources().getDrawable(android.R.drawable.ic_dialog_alert),
|
||||
getString(R.string.startscreen_attention_message_slot_gets_delete_on_load),
|
||||
null,
|
||||
true);
|
||||
CustomDialogFactory.addButton(d, android.R.string.ok, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
loadsave(slot);
|
||||
}
|
||||
});
|
||||
CustomDialogFactory.show(d);
|
||||
}
|
||||
|
||||
private void showConfirmoverwriteQuestion(final int slot, String message) {
|
||||
final String title =
|
||||
getString(R.string.loadsave_save_overwrite_confirmation_title) + ' '
|
||||
+ getString(R.string.loadsave_save_overwrite_confirmation_slot, slot);
|
||||
final Dialog d = CustomDialogFactory.createDialog(this,
|
||||
title,
|
||||
getResources().getDrawable(android.R.drawable.ic_dialog_alert),
|
||||
message,
|
||||
null,
|
||||
true);
|
||||
|
||||
CustomDialogFactory.addButton(d, android.R.string.yes, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
loadsave(slot);
|
||||
}
|
||||
});
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.no);
|
||||
CustomDialogFactory.show(d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@ import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CloudsAnimatorView;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
|
||||
public final class LoadingActivity extends Activity implements OnResourcesLoadedListener, OnSceneLoadedListener {
|
||||
public final class LoadingActivity extends AndorsTrailBaseActivity implements OnResourcesLoadedListener, OnSceneLoadedListener {
|
||||
|
||||
private WorldSetup setup;
|
||||
private Dialog progressDialog;
|
||||
private CloudsAnimatorView clouds_back, clouds_mid, clouds_front;
|
||||
boolean loaded = false;
|
||||
|
||||
|
||||
private Object semaphore = new Object();
|
||||
|
||||
@Override
|
||||
@@ -158,6 +158,8 @@ public final class LoadingActivity extends Activity implements OnResourcesLoaded
|
||||
}
|
||||
if (loadResult == Savegames.LoadSavegameResult.savegameIsFromAFutureVersion) {
|
||||
showLoadingFailedDialog(R.string.dialog_loading_failed_incorrectversion);
|
||||
} else if (loadResult == Savegames.LoadSavegameResult.cheatingDetected) {
|
||||
showLoadingFailedDialog(R.string.dialog_loading_failed_cheat);
|
||||
} else {
|
||||
showLoadingFailedDialog(R.string.dialog_loading_failed_message);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ import com.gpl.rpg.AndorsTrail.view.ToolboxView;
|
||||
import com.gpl.rpg.AndorsTrail.view.VirtualDpadView;
|
||||
|
||||
public final class MainActivity
|
||||
extends Activity
|
||||
extends AndorsTrailBaseActivity
|
||||
implements
|
||||
PlayerMovementListener
|
||||
, CombatActionListener
|
||||
@@ -149,6 +149,9 @@ public final class MainActivity
|
||||
final int slot = data.getIntExtra("slot", 1);
|
||||
if (save(slot)) {
|
||||
Toast.makeText(this, getResources().getString(R.string.menu_save_gamesaved, slot), Toast.LENGTH_SHORT).show();
|
||||
if (!world.model.statistics.hasUnlimitedSaves()) {
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, R.string.menu_save_failed, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
@@ -157,8 +160,7 @@ public final class MainActivity
|
||||
}
|
||||
|
||||
private boolean save(int slot) {
|
||||
final Player player = world.model.player;
|
||||
return Savegames.saveWorld(world, this, slot, getString(R.string.savegame_currenthero_displayinfo, player.getLevel(), player.getTotalExperience(), player.getGold()));
|
||||
return Savegames.saveWorld(world, this, slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,9 +190,11 @@ public final class MainActivity
|
||||
super.onResume();
|
||||
if (!AndorsTrailApplication.getApplicationFromActivity(this).getWorldSetup().isSceneReady) return;
|
||||
|
||||
controllers.gameRoundController.resume();
|
||||
|
||||
updateStatus();
|
||||
if (world.model.statistics.isDead()) this.finish();
|
||||
else {
|
||||
controllers.gameRoundController.resume();
|
||||
updateStatus();
|
||||
}
|
||||
}
|
||||
|
||||
private void unsubscribeFromModel() {
|
||||
@@ -452,7 +456,11 @@ public final class MainActivity
|
||||
|
||||
@Override
|
||||
public void onPlayerDied(int lostExp) {
|
||||
message(getString(R.string.combat_hero_dies, lostExp));
|
||||
if (!world.model.statistics.isDead()) {
|
||||
message(getString(R.string.combat_hero_dies, lostExp));
|
||||
} else {
|
||||
Dialogs.showHeroDied(this, controllers);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Monster;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public final class MonsterEncounterActivity extends Activity {
|
||||
public final class MonsterEncounterActivity extends AndorsTrailBaseActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.gpl.rpg.AndorsTrail.view.ItemEffectsView;
|
||||
import com.gpl.rpg.AndorsTrail.view.RangeBar;
|
||||
import com.gpl.rpg.AndorsTrail.view.TraitsInfoView;
|
||||
|
||||
public final class MonsterInfoActivity extends Activity {
|
||||
public final class MonsterInfoActivity extends AndorsTrailBaseActivity {
|
||||
|
||||
private WorldContext world;
|
||||
private ControllerContext controllers;
|
||||
|
||||
@@ -15,11 +15,22 @@ public final class Preferences extends PreferenceActivity {
|
||||
setTheme(ThemeHelper.getBaseTheme());
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
super.onCreate(savedInstanceState);
|
||||
if (AndorsTrailApplication.getApplicationFromActivity(this).getPreferences().fullscreen) {
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(this);
|
||||
if (app.getPreferences().fullscreen) {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
} else {
|
||||
getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
|
||||
app.setLocale(this);
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(this);
|
||||
app.setLocale(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.gpl.rpg.AndorsTrail.activity.fragment.ShopActivity_Buy;
|
||||
import com.gpl.rpg.AndorsTrail.activity.fragment.ShopActivity_Sell;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public final class ShopActivity extends FragmentActivity {
|
||||
public final class ShopActivity extends AndorsTrailBaseFragmentActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.gpl.rpg.AndorsTrail.model.ability.SkillInfo.SkillLevelRequirement;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Player;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public final class SkillInfoActivity extends Activity {
|
||||
public final class SkillInfoActivity extends AndorsTrailBaseActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -151,6 +151,7 @@ public final class SkillInfoActivity extends Activity {
|
||||
case specializationDualWield: return R.string.skill_title_specialization_dualwield;
|
||||
case specialization2hand: return R.string.skill_title_specialization_2hand;
|
||||
case specializationWeaponShield: return R.string.skill_title_specialization_weapon_shield;
|
||||
case weaponProficiencyPole: return R.string.skill_title_weapon_prof_pole;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
@@ -200,6 +201,7 @@ public final class SkillInfoActivity extends Activity {
|
||||
case specializationDualWield: return res.getString(R.string.skill_longdescription_specialization_dualwield, SkillCollection.PER_SKILLPOINT_INCREASE_SPECIALIZATION_DUALWIELD_AC_PERCENT, SkillCollection.PER_SKILLPOINT_INCREASE_SPECIALIZATION_DUALWIELD_BC_PERCENT);
|
||||
case specialization2hand: return res.getString(R.string.skill_longdescription_specialization_2hand, SkillCollection.PER_SKILLPOINT_INCREASE_SPECIALIZATION_2HAND_DMG_PERCENT, SkillCollection.PER_SKILLPOINT_INCREASE_SPECIALIZATION_2HAND_AC_PERCENT);
|
||||
case specializationWeaponShield: return res.getString(R.string.skill_longdescription_specialization_weapon_shield, SkillCollection.PER_SKILLPOINT_INCREASE_SPECIALIZATION_WEAPON_AC_PERCENT, SkillCollection.PER_SKILLPOINT_INCREASE_SPECIALIZATION_WEAPON_DMG_PERCENT);
|
||||
case weaponProficiencyPole: return res.getString(R.string.skill_longdescription_weapon_prof_pole, SkillCollection.PER_SKILLPOINT_INCREASE_WEAPON_PROF_AC_PERCENT, SkillCollection.PER_SKILLPOINT_INCREASE_WEAPON_PROF_BC_PERCENT, SkillCollection.PER_SKILLPOINT_INCREASE_WEAPON_PROF_CS_PERCENT);
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
public final class StartScreenActivity extends FragmentActivity implements OnNewGameRequestedListener, GameCreationOverListener, OnBackStackChangedListener {
|
||||
public final class StartScreenActivity extends AndorsTrailBaseFragmentActivity implements OnNewGameRequestedListener, GameCreationOverListener, OnBackStackChangedListener {
|
||||
|
||||
private TextView tv;
|
||||
private TextView development_version;
|
||||
|
||||
@@ -108,7 +108,7 @@ public final class HeroinfoActivity_Skills extends Fragment {
|
||||
|
||||
private void reloadShownSort() {
|
||||
int v = world.model.uiSelections.selectedSkillSort;
|
||||
if(v ==0);
|
||||
if(v==0) getCurrentCategoryAdapter().sortDefault();
|
||||
if(v==1) getCurrentCategoryAdapter().sortByName();
|
||||
if(v==2) getCurrentCategoryAdapter().sortByPoints();
|
||||
if(v==3) getCurrentCategoryAdapter().sortByUnlocked();
|
||||
|
||||
@@ -6,6 +6,10 @@ import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.SpannableString;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.RelativeSizeSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -19,6 +23,7 @@ import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.Dialogs;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.GameStatistics;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.HeroCollection;
|
||||
import com.gpl.rpg.AndorsTrail.model.actor.Player;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.Inventory;
|
||||
@@ -35,11 +40,13 @@ public final class HeroinfoActivity_Stats extends Fragment {
|
||||
|
||||
private WorldContext world;
|
||||
private Player player;
|
||||
private GameStatistics statistics;
|
||||
|
||||
private View view;
|
||||
private Button levelUpButton;
|
||||
private TextView heroinfo_reequip_cost;
|
||||
private TextView heroinfo_useitem_cost;
|
||||
private TextView heroinfo_mode;
|
||||
private TextView heroinfo_level;
|
||||
private TextView heroinfo_totalexperience;
|
||||
private TextView basetraitsinfo_max_hp;
|
||||
@@ -53,6 +60,7 @@ public final class HeroinfoActivity_Stats extends Fragment {
|
||||
private TableLayout heroinfo_basestats_table;
|
||||
private ViewGroup heroinfo_container;
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -60,6 +68,7 @@ public final class HeroinfoActivity_Stats extends Fragment {
|
||||
if (!app.isInitialized()) return;
|
||||
this.world = app.getWorld();
|
||||
this.player = world.model.player;
|
||||
this.statistics = world.model.statistics;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,6 +91,7 @@ public final class HeroinfoActivity_Stats extends Fragment {
|
||||
basetraitsinfo_max_ap = (TextView) v.findViewById(R.id.basetraitsinfo_max_ap);
|
||||
heroinfo_base_reequip_cost = (TextView) v.findViewById(R.id.heroinfo_base_reequip_cost);
|
||||
heroinfo_base_useitem_cost = (TextView) v.findViewById(R.id.heroinfo_base_useitem_cost);
|
||||
heroinfo_mode = (TextView) v.findViewById(R.id.heroinfo_mode);
|
||||
heroinfo_level = (TextView) v.findViewById(R.id.heroinfo_level);
|
||||
heroinfo_totalexperience = (TextView) v.findViewById(R.id.heroinfo_totalexperience);
|
||||
actorinfo_onhiteffects = (ItemEffectsView) v.findViewById(R.id.actorinfo_onhiteffects);
|
||||
@@ -137,7 +147,18 @@ public final class HeroinfoActivity_Stats extends Fragment {
|
||||
|
||||
private void updateTraits() {
|
||||
final Resources res = getResources();
|
||||
String mode = "";
|
||||
if (statistics.hasUnlimitedLives() && statistics.hasUnlimitedSaves()) {
|
||||
mode = res.getString(R.string.heroinfo_unlimited_lives_and_saves);
|
||||
} else if (statistics.hasUnlimitedLives()) {
|
||||
mode = res.getString(R.string.heroinfo_unlimited_lives);
|
||||
} else if (statistics.getStartLives() == 1) {
|
||||
mode = res.getString(R.string.heroinfo_one_life);
|
||||
} else {
|
||||
mode = res.getString(R.string.heroinfo_limited_lives, statistics.getLivesLeft(), statistics.getStartLives());
|
||||
}
|
||||
|
||||
heroinfo_mode.setText(mode);
|
||||
heroinfo_level.setText(Integer.toString(player.getLevel()));
|
||||
heroinfo_totalexperience.setText(Integer.toString(player.getTotalExperience()));
|
||||
// heroinfo_ap.update(player.getMaxAP() + "/" + player.getCurrentAP());
|
||||
|
||||
@@ -106,7 +106,27 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
startscreen_load.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
Dialogs.showLoad(StartScreenActivity_MainMenu.this);
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(getActivity());
|
||||
if (hasExistingGame && app != null && app.getWorld() != null && app.getWorld().model != null
|
||||
&& app.getWorld().model.statistics != null && !app.getWorld().model.statistics.hasUnlimitedSaves()) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(getActivity(),
|
||||
getString(R.string.startscreen_load_game),
|
||||
getResources().getDrawable(android.R.drawable.ic_delete),
|
||||
getString(R.string.startscreen_load_game_confirm),
|
||||
null,
|
||||
true);
|
||||
CustomDialogFactory.addButton(d, android.R.string.ok, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Dialogs.showLoad(StartScreenActivity_MainMenu.this);
|
||||
}
|
||||
});
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.cancel);
|
||||
CustomDialogFactory.show(d);
|
||||
|
||||
} else {
|
||||
Dialogs.showLoad(StartScreenActivity_MainMenu.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -131,12 +151,14 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
String playerName;
|
||||
String displayInfo = null;
|
||||
int iconID = TileManager.CHAR_HERO;
|
||||
boolean isDead = false;
|
||||
|
||||
FileHeader header = Savegames.quickload(getActivity(), Savegames.SLOT_QUICKSAVE);
|
||||
if (header != null && header.playerName != null) {
|
||||
playerName = header.playerName;
|
||||
displayInfo = header.displayInfo;
|
||||
iconID = header.iconID;
|
||||
isDead = header.isDead;
|
||||
} else {
|
||||
// Before fileversion 14 (v0.6.7), quicksave was stored in Shared preferences
|
||||
SharedPreferences p = getActivity().getSharedPreferences("quicksave", Activity.MODE_PRIVATE);
|
||||
@@ -146,7 +168,7 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
}
|
||||
}
|
||||
hasExistingGame = (playerName != null);
|
||||
setButtonState(playerName, displayInfo, iconID);
|
||||
setButtonState(playerName, displayInfo, iconID, isDead);
|
||||
|
||||
if (isNewVersion()) {
|
||||
Dialogs.showNewVersion(getActivity());
|
||||
@@ -168,13 +190,13 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
listener = null;
|
||||
}
|
||||
|
||||
private void setButtonState(final String playerName, final String displayInfo, int iconID) {
|
||||
startscreen_continue.setEnabled(hasExistingGame);
|
||||
private void setButtonState(final String playerName, final String displayInfo, int iconID, boolean isDead) {
|
||||
startscreen_continue.setEnabled(hasExistingGame && !isDead);
|
||||
startscreen_newgame.setEnabled(true);
|
||||
if (hasExistingGame) {
|
||||
TileManager tm = AndorsTrailApplication.getApplicationFromActivity(getActivity()).getWorld().tileManager;
|
||||
tm.setImageViewTileForPlayer(getResources(), save_preview_hero_icon, iconID);
|
||||
save_preview_hero_desc.setText(playerName + ", " + displayInfo);
|
||||
save_preview_hero_desc.setText((isDead ? getString(R.string.rip_startscreen) : "") + playerName + ", " + displayInfo);
|
||||
save_preview_holder.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
save_preview_holder.setVisibility(View.GONE);
|
||||
|
||||
@@ -20,12 +20,15 @@ import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.WorldSetup;
|
||||
import com.gpl.rpg.AndorsTrail.activity.LoadingActivity;
|
||||
import com.gpl.rpg.AndorsTrail.resource.tiles.TileManager;
|
||||
import com.gpl.rpg.AndorsTrail.view.SpinnerEmulator;
|
||||
|
||||
public class StartScreenActivity_NewGame extends Fragment {
|
||||
|
||||
private TextView startscreen_enterheroname;
|
||||
|
||||
private int selectedIconID = TileManager.CHAR_HERO;
|
||||
private int startLives = -1;
|
||||
private boolean unlimitedSaves = true;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
@@ -39,7 +42,40 @@ public class StartScreenActivity_NewGame extends Fragment {
|
||||
|
||||
|
||||
startscreen_enterheroname = (TextView) root.findViewById(R.id.startscreen_enterheroname);
|
||||
|
||||
|
||||
new SpinnerEmulator(root, R.id.startscreen_mode_selector_button, R.array.startscreen_mode_selector, R.string.startscreen_game_mode) {
|
||||
@Override
|
||||
public void setValue(int value) {
|
||||
if (value == 0) {
|
||||
startLives = -1;
|
||||
unlimitedSaves = true;
|
||||
} else {
|
||||
unlimitedSaves = false;
|
||||
if (value == 1) {
|
||||
startLives = -1;
|
||||
} else if (value == 2) {
|
||||
startLives = 50;
|
||||
} else if (value == 3) {
|
||||
startLives = 10;
|
||||
} else if (value == 4) {
|
||||
startLives = 3;
|
||||
} else {
|
||||
startLives = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectionChanged(int value) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getValue() {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
final RadioGroup group = (RadioGroup) root.findViewById(R.id.newgame_spritegroup);
|
||||
group.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
@@ -114,6 +150,8 @@ public class StartScreenActivity_NewGame extends Fragment {
|
||||
setup.loadFromSlot = loadFromSlot;
|
||||
setup.newHeroName = name;
|
||||
setup.newHeroIcon = selectedIconID;
|
||||
setup.newHeroStartLives = startLives;
|
||||
setup.newHeroUnlimitedSaves = unlimitedSaves;
|
||||
gameCreationOver();
|
||||
startActivity(new Intent(getActivity(), LoadingActivity.class));
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public final class CombatController implements VisualEffectCompletedCallback {
|
||||
setCombatSelection(null, null);
|
||||
world.model.uiSelections.isInCombat = false;
|
||||
combatTurnListeners.onCombatEnded();
|
||||
controllers.actorStatsController.setActorMaxAP(world.model.player);
|
||||
world.model.uiSelections.selectedPosition = null;
|
||||
world.model.uiSelections.selectedMonster = null;
|
||||
if (world.model.player.isDead()) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public final class Constants {
|
||||
public static final String FILENAME_WORLDMAP_HTMLFILE_SUFFIX = ".html";
|
||||
public static final String FILENAME_SAVEGAME_FILENAME_PREFIX = "savegame";
|
||||
public static final String PLACEHOLDER_PLAYERNAME = "$playername";
|
||||
public static final String CHEAT_DETECTION_FOLDER = "dEAGyGE3YojqXjI3x4x7";
|
||||
|
||||
public static final Random rnd = new Random();
|
||||
public static int rollValue(final ConstRange r) { return rollValue(r.max, r.current); }
|
||||
|
||||
@@ -307,6 +307,9 @@ public final class ConversationController {
|
||||
case factionScore:
|
||||
result = player.getAlignment(requirement.requireID) >= requirement.value;
|
||||
break;
|
||||
case factionScoreEquals:
|
||||
result = player.getAlignment(requirement.requireID) == requirement.value;
|
||||
break;
|
||||
default:
|
||||
result = true;
|
||||
}
|
||||
|
||||
@@ -129,8 +129,11 @@ public final class MapController {
|
||||
if (lostExp < 0) lostExp = 0;
|
||||
controllers.actorStatsController.addExperience(-lostExp);
|
||||
world.model.statistics.addPlayerDeath(lostExp);
|
||||
controllers.movementController.respawnPlayerAsync();
|
||||
lotsOfTimePassed();
|
||||
|
||||
if (!world.model.statistics.isDead()) {
|
||||
controllers.movementController.respawnPlayerAsync();
|
||||
lotsOfTimePassed();
|
||||
}
|
||||
worldEventListeners.onPlayerDied(lostExp);
|
||||
}
|
||||
|
||||
|
||||
@@ -284,11 +284,13 @@ public final class SkillController {
|
||||
return SkillID.weaponProficiency1hsword;
|
||||
else if (itemCategoryID.equals("2hsword"))
|
||||
return SkillID.weaponProficiency2hsword;
|
||||
else if (itemCategoryID.equals("axe") || itemCategoryID.equals("axe2h") || itemCategoryID.equals("scythe"))
|
||||
else if (itemCategoryID.equals("axe") || itemCategoryID.equals("axe2h"))
|
||||
return SkillID.weaponProficiencyAxe;
|
||||
else if (itemCategoryID.equals("club") || itemCategoryID.equals("staff") || itemCategoryID.equals("mace")
|
||||
|| itemCategoryID.equals("scepter") || itemCategoryID.equals("hammer") || itemCategoryID.equals("hammer2h") || itemCategoryID.equals("whip"))
|
||||
return SkillID.weaponProficiencyBlunt;
|
||||
else if (itemCategoryID.equals("pole"))
|
||||
return SkillID.weaponProficiencyPole;
|
||||
} else if (category.isShield()) {
|
||||
return SkillID.armorProficiencyShield;
|
||||
} else if (category.isArmor()) {
|
||||
|
||||
@@ -25,8 +25,14 @@ public final class GameStatistics {
|
||||
private final HashMap<String, Integer> killedMonsters = new HashMap<String, Integer>();
|
||||
private final HashMap<String, Integer> usedItems = new HashMap<String, Integer>();
|
||||
private int spentGold = 0;
|
||||
private boolean unlimitedSaves = true;
|
||||
private int startLives = -1; // -1 --> unlimited
|
||||
|
||||
public GameStatistics(boolean unlimitedSaves, int startLives) {
|
||||
this.unlimitedSaves = unlimitedSaves;
|
||||
this.startLives = startLives;
|
||||
}
|
||||
|
||||
public GameStatistics() { }
|
||||
public void addMonsterKill(String monsterTypeID) {
|
||||
if (!killedMonsters.containsKey(monsterTypeID)) killedMonsters.put(monsterTypeID, 1);
|
||||
else killedMonsters.put(monsterTypeID, killedMonsters.get(monsterTypeID) + 1);
|
||||
@@ -51,6 +57,16 @@ public final class GameStatistics {
|
||||
return spentGold;
|
||||
}
|
||||
|
||||
public boolean hasUnlimitedSaves() { return unlimitedSaves; }
|
||||
|
||||
public boolean hasUnlimitedLives() { return startLives == -1; }
|
||||
|
||||
public int getStartLives() { return startLives; }
|
||||
|
||||
public int getLivesLeft() { return hasUnlimitedLives() ? -1 : startLives - deaths; }
|
||||
|
||||
public boolean isDead() { return !hasUnlimitedLives() && getLivesLeft() < 1; }
|
||||
|
||||
public int getNumberOfKillsForMonsterType(String monsterTypeID) {
|
||||
Integer v = killedMonsters.get(monsterTypeID);
|
||||
if (v == null) return 0;
|
||||
@@ -167,6 +183,11 @@ public final class GameStatistics {
|
||||
this.usedItems.put(name, value);
|
||||
}
|
||||
this.spentGold = src.readInt();
|
||||
|
||||
if (fileversion < 49) return;
|
||||
|
||||
this.startLives = src.readInt();
|
||||
this.unlimitedSaves = src.readBoolean();
|
||||
}
|
||||
|
||||
public void writeToParcel(DataOutputStream dest) throws IOException {
|
||||
@@ -184,5 +205,7 @@ public final class GameStatistics {
|
||||
dest.writeInt(e.getValue());
|
||||
}
|
||||
dest.writeInt(spentGold);
|
||||
dest.writeInt(startLives);
|
||||
dest.writeBoolean(unlimitedSaves);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ public final class ModelContainer {
|
||||
public PredefinedMap currentMap;
|
||||
public LayeredTileMap currentTileMap;
|
||||
|
||||
public ModelContainer() {
|
||||
public ModelContainer(int startLives, boolean unlimitedSaves) {
|
||||
player = new Player();
|
||||
uiSelections = new InterfaceData();
|
||||
statistics = new GameStatistics();
|
||||
statistics = new GameStatistics(unlimitedSaves, startLives);
|
||||
worldData = new WorldData();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.gpl.rpg.AndorsTrail.model.ability;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import android.util.SparseArray;
|
||||
|
||||
@@ -53,6 +54,7 @@ public final class SkillCollection {
|
||||
,specializationDualWield
|
||||
,specialization2hand
|
||||
,specializationWeaponShield
|
||||
,weaponProficiencyPole
|
||||
}
|
||||
|
||||
// should be in the same number &U order as in arrays.xml
|
||||
@@ -134,103 +136,105 @@ public final class SkillCollection {
|
||||
public static final int MAX_LEVEL_LOWER_EXPLOSS = 100 / PER_SKILLPOINT_INCREASE_EXPLOSS_PERCENT;
|
||||
public static final int MAX_LEVEL_RESISTANCE = 70 / PER_SKILLPOINT_INCREASE_RESISTANCE_CHANCE_PERCENT;
|
||||
|
||||
private final SparseArray<SkillInfo> skills = new SparseArray<SkillInfo>();
|
||||
private final LinkedHashMap<Integer, SkillInfo> skills = new LinkedHashMap<Integer, SkillInfo>();
|
||||
private void initializeSkill(SkillInfo skill) {
|
||||
skills.put(skill.id.ordinal(), skill);
|
||||
}
|
||||
public void initialize() {
|
||||
initializeSkill(new SkillInfo(SkillID.weaponChance, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.offense, null));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponDmg, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.offense, null));
|
||||
initializeSkill(new SkillInfo(SkillID.barter, MAX_LEVEL_BARTER, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null));
|
||||
initializeSkill(new SkillInfo(SkillID.dodge, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.defense, null));
|
||||
int position = 0;
|
||||
initializeSkill(new SkillInfo(SkillID.weaponChance, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.offense, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponDmg, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.offense, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.barter, MAX_LEVEL_BARTER, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.dodge, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.defense, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.barkSkin, MAX_LEVEL_BARKSKIN, SkillInfo.LevelUpType.alwaysShown, SkillCategory.defense, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireExperienceLevels(10, 0)
|
||||
,SkillLevelRequirement.requirePlayerStats(Player.StatID.blockChance, 15, 0)
|
||||
}));
|
||||
initializeSkill(new SkillInfo(SkillID.moreCriticals, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.criticals, null));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.moreCriticals, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.criticals, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.betterCriticals, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.criticals, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.moreCriticals, 1)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.speed, MAX_LEVEL_SPEED, SkillInfo.LevelUpType.alwaysShown, SkillCategory.offense, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireExperienceLevels(15, 0)
|
||||
}));
|
||||
initializeSkill(new SkillInfo(SkillID.coinfinder, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null));
|
||||
initializeSkill(new SkillInfo(SkillID.moreExp, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.coinfinder, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.moreExp, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.cleave, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.offense, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.weaponChance, 1)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.weaponDmg, 1)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.eater, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requirePlayerStats(Player.StatID.maxHP, 20, 20)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.fortitude, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireExperienceLevels(15, -10)
|
||||
}));
|
||||
initializeSkill(new SkillInfo(SkillID.evasion, MAX_LEVEL_EVASION, SkillInfo.LevelUpType.alwaysShown, SkillCategory.defense, null));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.evasion, MAX_LEVEL_EVASION, SkillInfo.LevelUpType.alwaysShown, SkillCategory.defense, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.regeneration, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requirePlayerStats(Player.StatID.maxHP, 30, 0)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.fortitude, 1)
|
||||
}));
|
||||
initializeSkill(new SkillInfo(SkillID.lowerExploss, MAX_LEVEL_LOWER_EXPLOSS, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null));
|
||||
initializeSkill(new SkillInfo(SkillID.magicfinder, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null));
|
||||
initializeSkill(new SkillInfo(SkillID.resistanceMental, MAX_LEVEL_RESISTANCE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, null));
|
||||
initializeSkill(new SkillInfo(SkillID.resistancePhysical, MAX_LEVEL_RESISTANCE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, null));
|
||||
initializeSkill(new SkillInfo(SkillID.resistanceBlood, MAX_LEVEL_RESISTANCE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, null));
|
||||
initializeSkill(new SkillInfo(SkillID.shadowBless, 1, SkillInfo.LevelUpType.onlyByQuests, SkillCategory.immunity, null));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.lowerExploss, MAX_LEVEL_LOWER_EXPLOSS, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.magicfinder, SkillInfo.MAXLEVEL_NONE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.utility, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.resistanceMental, MAX_LEVEL_RESISTANCE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.resistancePhysical, MAX_LEVEL_RESISTANCE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.resistanceBlood, MAX_LEVEL_RESISTANCE, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.shadowBless, 1, SkillInfo.LevelUpType.onlyByQuests, SkillCategory.immunity, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.crit1, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.criticals, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.moreCriticals, 3)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.betterCriticals, 3)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.crit2, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.criticals, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.moreCriticals, 6)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.betterCriticals, 6)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.crit1, 1)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.rejuvenation, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.immunity, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.resistanceBlood, 3)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.resistanceMental, 3)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.resistancePhysical, 3)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.taunt, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.defense, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.evasion, 2)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.dodge, 4)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.concussion, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.offense, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireOtherSkill(SkillID.speed, 2)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.weaponChance, 3)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.weaponDmg, 5)
|
||||
}));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiencyDagger, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiency1hsword, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiency2hsword, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiencyAxe, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiencyBlunt, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiencyUnarmed, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
initializeSkill(new SkillInfo(SkillID.armorProficiencyShield, 2, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
initializeSkill(new SkillInfo(SkillID.armorProficiencyUnarmored, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
initializeSkill(new SkillInfo(SkillID.armorProficiencyLight, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
initializeSkill(new SkillInfo(SkillID.armorProficiencyHeavy, 4, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiencyDagger, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiency1hsword, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiency2hsword, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiencyAxe, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiencyBlunt, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiencyUnarmed, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.weaponProficiencyPole, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.armorProficiencyShield, 2, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.armorProficiencyUnarmored, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.armorProficiencyLight, 3, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.armorProficiencyHeavy, 4, SkillInfo.LevelUpType.firstLevelRequiresQuest, SkillCategory.proficiency, null, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.fightstyleDualWield, 2, SkillInfo.LevelUpType.alwaysShown, SkillCategory.specialty, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireExperienceLevels(15, 0)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.fightstyle2hand, 2, SkillInfo.LevelUpType.alwaysShown, SkillCategory.specialty, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireExperienceLevels(15, 0)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.fightstyleWeaponShield, 2, SkillInfo.LevelUpType.alwaysShown, SkillCategory.specialty, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireExperienceLevels(15, 0)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.specializationDualWield, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.specialty, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireExperienceLevels(45, 0)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.fightstyleDualWield, 2)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.specialization2hand, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.specialty, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireExperienceLevels(45, 0)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.fightstyle2hand, 2)
|
||||
}));
|
||||
}, position++));
|
||||
initializeSkill(new SkillInfo(SkillID.specializationWeaponShield, 1, SkillInfo.LevelUpType.alwaysShown, SkillCategory.specialty, new SkillLevelRequirement[] {
|
||||
SkillLevelRequirement.requireExperienceLevels(45, 0)
|
||||
,SkillLevelRequirement.requireOtherSkill(SkillID.fightstyleWeaponShield, 2)
|
||||
}));
|
||||
}, position++));
|
||||
}
|
||||
|
||||
public SkillInfo getSkill(SkillID skillID) {
|
||||
@@ -239,7 +243,7 @@ public final class SkillCollection {
|
||||
|
||||
public Collection<SkillInfo> getAllSkills() {
|
||||
ArrayList<SkillInfo> result = new ArrayList<SkillInfo>(skills.size());
|
||||
for(int i = 0; i < skills.size(); ++i) result.add(skills.valueAt(i));
|
||||
for(int i = 0; i < skills.size(); ++i) result.add(skills.get(i));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,18 +15,21 @@ public final class SkillInfo {
|
||||
public final LevelUpType levelupVisibility;
|
||||
public final SkillLevelRequirement[] levelupRequirements;
|
||||
public final SkillCollection.SkillCategory categoryType;
|
||||
public final int position;
|
||||
public SkillInfo(
|
||||
SkillCollection.SkillID id
|
||||
, int maxLevel
|
||||
, LevelUpType levelupVisibility
|
||||
, SkillCollection.SkillCategory categoryType
|
||||
, SkillLevelRequirement[] levelupRequirements
|
||||
, int position
|
||||
) {
|
||||
this.id = id;
|
||||
this.maxLevel = maxLevel;
|
||||
this.levelupVisibility = levelupVisibility;
|
||||
this.levelupRequirements = levelupRequirements;
|
||||
this.categoryType = categoryType;
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public boolean hasMaxLevel() {
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
import android.util.SparseIntArray;
|
||||
|
||||
@@ -44,6 +45,8 @@ public final class Player extends Actor {
|
||||
private String spawnMap;
|
||||
private String spawnPlace;
|
||||
private final HashMap<String, Integer> alignments = new HashMap<String, Integer>();
|
||||
public String id = UUID.randomUUID().toString();
|
||||
public long savedVersion = 1; // the version get's increased for cheat detection everytime a player with limited saves is saved
|
||||
|
||||
// Unequipped stats
|
||||
public static final class PlayerBaseTraits {
|
||||
@@ -365,6 +368,11 @@ public final class Player extends Actor {
|
||||
this.alignments.put(faction, alignment);
|
||||
}
|
||||
}
|
||||
|
||||
if (fileversion >= 49) {
|
||||
this.id = src.readUTF();
|
||||
this.savedVersion = src.readLong();
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToParcel(DataOutputStream dest) throws IOException {
|
||||
@@ -421,6 +429,8 @@ public final class Player extends Actor {
|
||||
dest.writeUTF(e.getKey());
|
||||
dest.writeInt(e.getValue());
|
||||
}
|
||||
dest.writeUTF(id);
|
||||
dest.writeLong(savedVersion);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ public final class Requirement {
|
||||
,hasActorCondition
|
||||
,factionScore
|
||||
,random
|
||||
,factionScoreEquals
|
||||
}
|
||||
|
||||
public final RequirementType requireType;
|
||||
@@ -83,6 +84,8 @@ public final class Requirement {
|
||||
case timerElapsed:
|
||||
return requireID != null && value >= 0;
|
||||
case wear:
|
||||
case factionScore:
|
||||
case factionScoreEquals:
|
||||
return requireID != null;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@@ -1,427 +1,429 @@
|
||||
package com.gpl.rpg.AndorsTrail.resource;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.Collection;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.conversation.ConversationCollection;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.TMXMapTranslator;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.ActorConditionsTypeParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.ConversationListParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.DropListParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.ItemCategoryParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.ItemTypeParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.MonsterTypeParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.QuestParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.WorldMapParser;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
import com.gpl.rpg.AndorsTrail.util.Size;
|
||||
|
||||
public final class ResourceLoader {
|
||||
|
||||
private static final int itemCategoriesResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_itemcategories_debug : R.array.loadresource_itemcategories;
|
||||
private static final int actorConditionsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_actorconditions_debug : R.array.loadresource_actorconditions;
|
||||
private static final int itemsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_items_debug : R.array.loadresource_items;
|
||||
private static final int droplistsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_droplists_debug : R.array.loadresource_droplists;
|
||||
private static final int questsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_quests_debug : R.array.loadresource_quests;
|
||||
private static final int conversationsListsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_conversationlists_debug : R.array.loadresource_conversationlists;
|
||||
private static final int monstersResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_monsters_debug : R.array.loadresource_monsters;
|
||||
private static final int mapsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_maps_debug : R.array.loadresource_maps;
|
||||
|
||||
private static DynamicTileLoader loader;
|
||||
private static TranslationLoader translationLoader;
|
||||
private static long taskStart;
|
||||
private static void timingCheckpoint(String loaderName) {
|
||||
long now = System.currentTimeMillis();
|
||||
long duration = now - taskStart;
|
||||
L.log(loaderName + " ran for " + duration + " ms.");
|
||||
taskStart = now;
|
||||
}
|
||||
|
||||
public static void loadResourcesSync(WorldContext world, Resources r) {
|
||||
long start = System.currentTimeMillis();
|
||||
taskStart = start;
|
||||
|
||||
final int mTileSize = world.tileManager.tileSize;
|
||||
|
||||
|
||||
loader = new DynamicTileLoader(world.tileManager.tileCache);
|
||||
prepareTilesets(loader, mTileSize);
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("prepareTilesets");
|
||||
|
||||
// ========================================================================
|
||||
// Load various ui icons
|
||||
// HeroCollection.prepareHeroesTileId(loader);
|
||||
/*TileManager.iconID_CHAR_HERO_0 = */loader.prepareTileID(R.drawable.char_hero, 0);
|
||||
/*TileManager.iconID_CHAR_HERO_1 = */loader.prepareTileID(R.drawable.char_hero_maksiu_girl_01, 0);
|
||||
/*TileManager.iconID_CHAR_HERO_2 = */loader.prepareTileID(R.drawable.char_hero_maksiu_boy_01, 0);
|
||||
/*TileManager.iconID_selection_red = */loader.prepareTileID(R.drawable.ui_selections, 0);
|
||||
/*TileManager.iconID_selection_yellow = */loader.prepareTileID(R.drawable.ui_selections, 1);
|
||||
/*TileManager.iconID_groundbag = */loader.prepareTileID(R.drawable.ui_icon_equipment, 0);
|
||||
/*TileManager.iconID_boxopened = */loader.prepareTileID(R.drawable.ui_quickslots, 1);
|
||||
/*TileManager.iconID_boxclosed = */loader.prepareTileID(R.drawable.ui_quickslots, 0);
|
||||
/*TileManager.iconID_selection_blue = */loader.prepareTileID(R.drawable.ui_selections, 2);
|
||||
/*TileManager.iconID_selection_purple = */loader.prepareTileID(R.drawable.ui_selections, 3);
|
||||
/*TileManager.iconID_selection_green = */loader.prepareTileID(R.drawable.ui_selections, 4);
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
loader.prepareTileID(R.drawable.ui_splatters1, i);
|
||||
loader.prepareTileID(R.drawable.ui_splatters1, i+8);
|
||||
}
|
||||
loader.prepareTileID(R.drawable.ui_icon_immunity, 0);
|
||||
|
||||
//Placeholders for dynamic map tiles
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 0);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 1);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 2);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 3);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 4);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 5);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 6);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 7);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 8);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 9);
|
||||
|
||||
// Load effects
|
||||
world.visualEffectTypes.initialize(loader);
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("VisualEffectLoader");
|
||||
|
||||
translationLoader = new TranslationLoader(r.getAssets(), r);
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load skills
|
||||
world.skills.initialize();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("SkillLoader");
|
||||
|
||||
// ========================================================================
|
||||
// Load item categories
|
||||
final ItemCategoryParser itemCategoryParser = new ItemCategoryParser(translationLoader);
|
||||
final TypedArray categoriesToLoad = r.obtainTypedArray(itemCategoriesResourceId);
|
||||
for (int i = 0; i < categoriesToLoad.length(); ++i) {
|
||||
world.itemCategories.initialize(itemCategoryParser, readStringFromRaw(r, categoriesToLoad, i));
|
||||
}
|
||||
categoriesToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("ItemCategoryParser");
|
||||
|
||||
// ========================================================================
|
||||
// Load condition types
|
||||
final ActorConditionsTypeParser actorConditionsTypeParser = new ActorConditionsTypeParser(loader, translationLoader);
|
||||
final TypedArray conditionsToLoad = r.obtainTypedArray(actorConditionsResourceId);
|
||||
for (int i = 0; i < conditionsToLoad.length(); ++i) {
|
||||
world.actorConditionsTypes.initialize(actorConditionsTypeParser, readStringFromRaw(r, conditionsToLoad, i));
|
||||
}
|
||||
conditionsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("ActorConditionsTypeParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load preloaded tiles
|
||||
loader.flush();
|
||||
world.tileManager.loadPreloadedTiles(r);
|
||||
}
|
||||
|
||||
public static void loadResourcesAsync(WorldContext world, Resources r) {
|
||||
long start = System.currentTimeMillis();
|
||||
taskStart = start;
|
||||
|
||||
// ========================================================================
|
||||
// Load items
|
||||
final ItemTypeParser itemTypeParser = new ItemTypeParser(loader, world.actorConditionsTypes, world.itemCategories, translationLoader);
|
||||
final TypedArray itemsToLoad = r.obtainTypedArray(itemsResourceId);
|
||||
for (int i = 0; i < itemsToLoad.length(); ++i) {
|
||||
world.itemTypes.initialize(itemTypeParser, readStringFromRaw(r, itemsToLoad, i));
|
||||
}
|
||||
itemsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("ItemTypeParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load droplists
|
||||
final DropListParser dropListParser = new DropListParser(world.itemTypes);
|
||||
final TypedArray droplistsToLoad = r.obtainTypedArray(droplistsResourceId);
|
||||
for (int i = 0; i < droplistsToLoad.length(); ++i) {
|
||||
world.dropLists.initialize(dropListParser, readStringFromRaw(r, droplistsToLoad, i));
|
||||
}
|
||||
droplistsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("DropListParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load quests
|
||||
final QuestParser questParser = new QuestParser(translationLoader);
|
||||
final TypedArray questsToLoad = r.obtainTypedArray(questsResourceId);
|
||||
for (int i = 0; i < questsToLoad.length(); ++i) {
|
||||
world.quests.initialize(questParser, readStringFromRaw(r, questsToLoad, i));
|
||||
}
|
||||
questsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("QuestParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load conversations
|
||||
final ConversationListParser conversationListParser = new ConversationListParser(translationLoader);
|
||||
final TypedArray conversationsListsToLoad = r.obtainTypedArray(conversationsListsResourceId);
|
||||
for (int i = 0; i < conversationsListsToLoad.length(); ++i) {
|
||||
ConversationCollection conversations = new ConversationCollection();
|
||||
Collection<String> ids = conversations.initialize(conversationListParser, readStringFromRaw(r, conversationsListsToLoad, i));
|
||||
world.conversationLoader.addIDs(conversationsListsToLoad.getResourceId(i, -1), ids);
|
||||
}
|
||||
conversationsListsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("ConversationListParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load monsters
|
||||
final MonsterTypeParser monsterTypeParser = new MonsterTypeParser(world.dropLists, world.actorConditionsTypes, loader, translationLoader);
|
||||
final TypedArray monstersToLoad = r.obtainTypedArray(monstersResourceId);
|
||||
for (int i = 0; i < monstersToLoad.length(); ++i) {
|
||||
world.monsterTypes.initialize(monsterTypeParser, readStringFromRaw(r, monstersToLoad, i));
|
||||
}
|
||||
monstersToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("MonsterTypeParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load maps
|
||||
TMXMapTranslator mapReader = new TMXMapTranslator();
|
||||
final TypedArray mapsToLoad = r.obtainTypedArray(mapsResourceId);
|
||||
for (int i = 0; i < mapsToLoad.length(); ++i) {
|
||||
final int mapResourceId = mapsToLoad.getResourceId(i, -1);
|
||||
final String mapName = r.getResourceEntryName(mapResourceId);
|
||||
mapReader.read(r, mapResourceId, mapName);
|
||||
}
|
||||
mapsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("TMXMapReader");
|
||||
world.maps.addAll(mapReader.transformMaps(world.monsterTypes, world.dropLists));
|
||||
loader.prepareAllMapTiles();
|
||||
mapReader = null;
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("mapReader.transformMaps");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load graphics resources (icons and tiles)
|
||||
loader.flush();
|
||||
loader = null;
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("DynamicTileLoader");
|
||||
// ========================================================================
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load worldmap coordinates
|
||||
WorldMapParser.read(r, R.xml.worldmap, world.maps, translationLoader);
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("WorldMapParser");
|
||||
// ========================================================================
|
||||
|
||||
translationLoader.close();
|
||||
|
||||
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
|
||||
long duration = System.currentTimeMillis() - start;
|
||||
L.log("ResourceLoader ran for " + duration + " ms.");
|
||||
}
|
||||
}
|
||||
|
||||
public static String readStringFromRaw(final Resources r, final TypedArray array, final int index) {
|
||||
return readStringFromRaw(r, array.getResourceId(index, -1));
|
||||
}
|
||||
public static String readStringFromRaw(final Resources r, final int resourceID) {
|
||||
InputStream is = r.openRawResource(resourceID);
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
||||
StringBuilder sb = new StringBuilder(1000);
|
||||
String line;
|
||||
try {
|
||||
while((line = br.readLine()) != null) sb.append(line);
|
||||
br.close();
|
||||
is.close();
|
||||
return sb.toString();
|
||||
} catch (IOException e) {
|
||||
L.log("ERROR: Reading from resource " + resourceID + " failed. " + e.toString());
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private static void prepareTilesets(DynamicTileLoader loader, int mTileSize) {
|
||||
final Size sz1x1 = new Size(1, 1);
|
||||
final Size sz2x1 = new Size(2, 1);
|
||||
final Size sz2x2 = new Size(2, 2);
|
||||
final Size sz2x3 = new Size(2, 3);
|
||||
final Size sz3x1 = new Size(3, 1);
|
||||
final Size sz6x1 = new Size(6, 1);
|
||||
final Size sz7x1 = new Size(7, 1);
|
||||
final Size sz20x12 = new Size(20, 12);
|
||||
final Size mapTileSize = new Size(16, 8);
|
||||
|
||||
loader.prepareTileset(R.drawable.char_hero, "char_hero", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.char_hero_maksiu_girl_01, "char_hero_maksiu_girl_01", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.char_hero_maksiu_boy_01, "char_hero_maksiu_boy_01", sz1x1, sz1x1, mTileSize);
|
||||
|
||||
loader.prepareTileset(R.drawable.ui_selections, "ui_selections", new Size(5, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.ui_quickslots, "ui_quickslots", sz2x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.ui_icon_equipment, "ui_icon_equipment", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.ui_splatters1, "ui_splatters1", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.ui_icon_immunity, "ui_icon_immunity", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_dynamic_placeholders, "map_dynamic_placeholders", new Size(10, 2), sz1x1, mTileSize);
|
||||
|
||||
loader.prepareTileset(R.drawable.actorconditions_1, "actorconditions_1", new Size(14, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_2, "actorconditions_2", sz3x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_japozero, "actorconditions_japozero", new Size(16, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_omi1, "actorconditions_omi1", sz2x1, sz1x1, mTileSize);
|
||||
/*INSERT_ACTORCONDITIONS_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.items_armours, "items_armours", new Size(14, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_weapons, "items_weapons", new Size(14, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_jewelry, "items_jewelry", new Size(14, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_consumables, "items_consumables", new Size(14, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_books, "items_books", new Size(11, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc, "items_misc", new Size(14, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_2, "items_misc_2", sz20x12, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_3, "items_misc_3", sz20x12, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_4, "items_misc_4", new Size(20, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_5, "items_misc_5", new Size(9, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_6, "items_misc_6", new Size(9, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_reterski_1, "items_reterski_1", new Size(3, 10), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_tometik1, "items_tometik1", new Size(6, 10), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_tometik2, "items_tometik2", new Size(10, 10), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_tometik3, "items_tometik3", new Size(8, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_necklaces_1, "items_necklaces_1", new Size(10, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_weapons_2, "items_weapons_2", new Size(7, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_weapons_3, "items_weapons_3", new Size(13, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_armours_2, "items_armours_2", sz7x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_armours_3, "items_armours_3", new Size(10, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_rings_1, "items_rings_1", new Size(10, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_japozero, "items_japozero", new Size(16, 37), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_rijackson_1, "items_rijackson_1", new Size(5, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_g03_package_omi1, "items_g03_package_omi1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_consumables_omi1, "items_consumables_omi1", sz1x1, sz1x1, mTileSize);
|
||||
/*INSERT_ITEMS_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.monsters_armor1, "monsters_armor1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_cyclops, "monsters_cyclops", sz1x1, sz2x3, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_demon1, "monsters_demon1", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_demon2, "monsters_demon2", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_dogs, "monsters_dogs", sz7x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye1, "monsters_eye1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye2, "monsters_eye2", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye3, "monsters_eye3", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye4, "monsters_eye4", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ghost1, "monsters_ghost1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_hydra1, "monsters_hydra1", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_insects, "monsters_insects", sz6x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_karvis1, "monsters_karvis1", sz2x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_karvis2, "monsters_karvis2", new Size(9, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ld1, "monsters_ld1", new Size(20, 12), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ld2, "monsters_ld2", new Size(20, 12), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_liches, "monsters_liches", new Size(4, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_mage, "monsters_mage", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_mage2, "monsters_mage2", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_man1, "monsters_man1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_men, "monsters_men", new Size(9, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_men2, "monsters_men2", new Size(10, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_misc, "monsters_misc", new Size(12, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rats, "monsters_rats", new Size(5, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_redshrike1, "monsters_redshrike1", sz7x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rltiles1, "monsters_rltiles1", new Size(20, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rltiles2, "monsters_rltiles2", new Size(20, 9), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rltiles3, "monsters_rltiles3", new Size(10, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rltiles4, "monsters_rltiles4", new Size(12, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rogue1, "monsters_rogue1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_skeleton1, "monsters_skeleton1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_skeleton2, "monsters_skeleton2", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_snakes, "monsters_snakes", sz6x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik1, "monsters_tometik1", new Size(10, 9), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik2, "monsters_tometik2", new Size(8, 10), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik3, "monsters_tometik3", new Size(6, 13), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik4, "monsters_tometik4", new Size(6, 13), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik5, "monsters_tometik5", new Size(6, 16), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik6, "monsters_tometik6", new Size(7, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik7, "monsters_tometik7", new Size(8, 11), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik8, "monsters_tometik8", new Size(7, 9), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik9, "monsters_tometik9", new Size(8, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik10, "monsters_tometik10", new Size(6, 13), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_wraiths, "monsters_wraiths", sz3x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_zombie1, "monsters_zombie1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_zombie2, "monsters_zombie2", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_guynmart, "monsters_guynmart", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_maksiu1, "monsters_maksiu1", new Size(4, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_omi1, "monsters_omi1", sz2x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_omi1_b, "monsters_omi1_b", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_unknown, "monsters_unknown", sz1x1, sz1x1, mTileSize);
|
||||
/*INSERT_NPCS_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.map_bed_1, "map_bed_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_border_1, "map_border_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_bridge_1, "map_bridge_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_bridge_2, "map_bridge_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_broken_1, "map_broken_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_1, "map_cavewall_1", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_2, "map_cavewall_2", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_3, "map_cavewall_3", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_4, "map_cavewall_4", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_chair_table_1, "map_chair_table_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_chair_table_2, "map_chair_table_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_crate_1, "map_crate_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cupboard_1, "map_cupboard_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_curtain_1, "map_curtain_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_entrance_1, "map_entrance_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_entrance_2, "map_entrance_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_1, "map_fence_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_2, "map_fence_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_3, "map_fence_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_4, "map_fence_4", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_1, "map_ground_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_2, "map_ground_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_3, "map_ground_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_4, "map_ground_4", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_5, "map_ground_5", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_6, "map_ground_6", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_7, "map_ground_7", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_8, "map_ground_8", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_house_1, "map_house_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_house_2, "map_house_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_indoor_1, "map_indoor_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_indoor_2, "map_indoor_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_kitchen_1, "map_kitchen_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_outdoor_1, "map_outdoor_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_pillar_1, "map_pillar_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_pillar_2, "map_pillar_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_plant_1, "map_plant_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_plant_2, "map_plant_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_rock_1, "map_rock_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_rock_2, "map_rock_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_1, "map_roof_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_2, "map_roof_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_3, "map_roof_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_shop_1, "map_shop_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_sign_ladder_1, "map_sign_ladder_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_table_1, "map_table_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_trail_1, "map_trail_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_1, "map_transition_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_2, "map_transition_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_3, "map_transition_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_4, "map_transition_4", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_5, "map_transition_5", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_tree_1, "map_tree_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_tree_2, "map_tree_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_1, "map_wall_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_2, "map_wall_2", new Size(15, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_3, "map_wall_3", new Size(15, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_4, "map_wall_4", new Size(15, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_window_1, "map_window_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_window_2, "map_window_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_guynmart, "map_guynmart", mapTileSize, sz1x1, mTileSize);
|
||||
/*INSERT_MAP_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.effect_blood4, "effect_blood4", new Size(7, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.effect_heal2, "effect_heal2", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.effect_poison1, "effect_poison1", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.effect_miss1, "effect_miss1", new Size(8, 2), sz1x1, mTileSize);
|
||||
}
|
||||
}
|
||||
package com.gpl.rpg.AndorsTrail.resource;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.Collection;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.model.conversation.ConversationCollection;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.TMXMapTranslator;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.ActorConditionsTypeParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.ConversationListParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.DropListParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.ItemCategoryParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.ItemTypeParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.MonsterTypeParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.QuestParser;
|
||||
import com.gpl.rpg.AndorsTrail.resource.parsers.WorldMapParser;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
import com.gpl.rpg.AndorsTrail.util.Size;
|
||||
|
||||
public final class ResourceLoader {
|
||||
|
||||
private static final int itemCategoriesResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_itemcategories_debug : R.array.loadresource_itemcategories;
|
||||
private static final int actorConditionsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_actorconditions_debug : R.array.loadresource_actorconditions;
|
||||
private static final int itemsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_items_debug : R.array.loadresource_items;
|
||||
private static final int droplistsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_droplists_debug : R.array.loadresource_droplists;
|
||||
private static final int questsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_quests_debug : R.array.loadresource_quests;
|
||||
private static final int conversationsListsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_conversationlists_debug : R.array.loadresource_conversationlists;
|
||||
private static final int monstersResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_monsters_debug : R.array.loadresource_monsters;
|
||||
private static final int mapsResourceId = AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES ? R.array.loadresource_maps_debug : R.array.loadresource_maps;
|
||||
|
||||
private static DynamicTileLoader loader;
|
||||
private static TranslationLoader translationLoader;
|
||||
private static long taskStart;
|
||||
private static void timingCheckpoint(String loaderName) {
|
||||
long now = System.currentTimeMillis();
|
||||
long duration = now - taskStart;
|
||||
L.log(loaderName + " ran for " + duration + " ms.");
|
||||
taskStart = now;
|
||||
}
|
||||
|
||||
public static void loadResourcesSync(WorldContext world, Resources r) {
|
||||
long start = System.currentTimeMillis();
|
||||
taskStart = start;
|
||||
|
||||
final int mTileSize = world.tileManager.tileSize;
|
||||
|
||||
|
||||
loader = new DynamicTileLoader(world.tileManager.tileCache);
|
||||
prepareTilesets(loader, mTileSize);
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("prepareTilesets");
|
||||
|
||||
// ========================================================================
|
||||
// Load various ui icons
|
||||
// HeroCollection.prepareHeroesTileId(loader);
|
||||
/*TileManager.iconID_CHAR_HERO_0 = */loader.prepareTileID(R.drawable.char_hero, 0);
|
||||
/*TileManager.iconID_CHAR_HERO_1 = */loader.prepareTileID(R.drawable.char_hero_maksiu_girl_01, 0);
|
||||
/*TileManager.iconID_CHAR_HERO_2 = */loader.prepareTileID(R.drawable.char_hero_maksiu_boy_01, 0);
|
||||
/*TileManager.iconID_selection_red = */loader.prepareTileID(R.drawable.ui_selections, 0);
|
||||
/*TileManager.iconID_selection_yellow = */loader.prepareTileID(R.drawable.ui_selections, 1);
|
||||
/*TileManager.iconID_groundbag = */loader.prepareTileID(R.drawable.ui_icon_equipment, 0);
|
||||
/*TileManager.iconID_boxopened = */loader.prepareTileID(R.drawable.ui_quickslots, 1);
|
||||
/*TileManager.iconID_boxclosed = */loader.prepareTileID(R.drawable.ui_quickslots, 0);
|
||||
/*TileManager.iconID_selection_blue = */loader.prepareTileID(R.drawable.ui_selections, 2);
|
||||
/*TileManager.iconID_selection_purple = */loader.prepareTileID(R.drawable.ui_selections, 3);
|
||||
/*TileManager.iconID_selection_green = */loader.prepareTileID(R.drawable.ui_selections, 4);
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
loader.prepareTileID(R.drawable.ui_splatters1, i);
|
||||
loader.prepareTileID(R.drawable.ui_splatters1, i+8);
|
||||
}
|
||||
loader.prepareTileID(R.drawable.ui_icon_immunity, 0);
|
||||
|
||||
//Placeholders for dynamic map tiles
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 0);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 1);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 2);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 3);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 4);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 5);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 6);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 7);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 8);
|
||||
loader.prepareTileID(R.drawable.map_dynamic_placeholders, 9);
|
||||
|
||||
// Load effects
|
||||
world.visualEffectTypes.initialize(loader);
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("VisualEffectLoader");
|
||||
|
||||
translationLoader = new TranslationLoader(r.getAssets(), r);
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load skills
|
||||
world.skills.initialize();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("SkillLoader");
|
||||
|
||||
// ========================================================================
|
||||
// Load item categories
|
||||
final ItemCategoryParser itemCategoryParser = new ItemCategoryParser(translationLoader);
|
||||
final TypedArray categoriesToLoad = r.obtainTypedArray(itemCategoriesResourceId);
|
||||
for (int i = 0; i < categoriesToLoad.length(); ++i) {
|
||||
world.itemCategories.initialize(itemCategoryParser, readStringFromRaw(r, categoriesToLoad, i));
|
||||
}
|
||||
categoriesToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("ItemCategoryParser");
|
||||
|
||||
// ========================================================================
|
||||
// Load condition types
|
||||
final ActorConditionsTypeParser actorConditionsTypeParser = new ActorConditionsTypeParser(loader, translationLoader);
|
||||
final TypedArray conditionsToLoad = r.obtainTypedArray(actorConditionsResourceId);
|
||||
for (int i = 0; i < conditionsToLoad.length(); ++i) {
|
||||
world.actorConditionsTypes.initialize(actorConditionsTypeParser, readStringFromRaw(r, conditionsToLoad, i));
|
||||
}
|
||||
conditionsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("ActorConditionsTypeParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load preloaded tiles
|
||||
loader.flush();
|
||||
world.tileManager.loadPreloadedTiles(r);
|
||||
}
|
||||
|
||||
public static void loadResourcesAsync(WorldContext world, Resources r) {
|
||||
long start = System.currentTimeMillis();
|
||||
taskStart = start;
|
||||
|
||||
// ========================================================================
|
||||
// Load items
|
||||
final ItemTypeParser itemTypeParser = new ItemTypeParser(loader, world.actorConditionsTypes, world.itemCategories, translationLoader);
|
||||
final TypedArray itemsToLoad = r.obtainTypedArray(itemsResourceId);
|
||||
for (int i = 0; i < itemsToLoad.length(); ++i) {
|
||||
world.itemTypes.initialize(itemTypeParser, readStringFromRaw(r, itemsToLoad, i));
|
||||
}
|
||||
itemsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("ItemTypeParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load droplists
|
||||
final DropListParser dropListParser = new DropListParser(world.itemTypes);
|
||||
final TypedArray droplistsToLoad = r.obtainTypedArray(droplistsResourceId);
|
||||
for (int i = 0; i < droplistsToLoad.length(); ++i) {
|
||||
world.dropLists.initialize(dropListParser, readStringFromRaw(r, droplistsToLoad, i));
|
||||
}
|
||||
droplistsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("DropListParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load quests
|
||||
final QuestParser questParser = new QuestParser(translationLoader);
|
||||
final TypedArray questsToLoad = r.obtainTypedArray(questsResourceId);
|
||||
for (int i = 0; i < questsToLoad.length(); ++i) {
|
||||
world.quests.initialize(questParser, readStringFromRaw(r, questsToLoad, i));
|
||||
}
|
||||
questsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("QuestParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load conversations
|
||||
final ConversationListParser conversationListParser = new ConversationListParser(translationLoader);
|
||||
final TypedArray conversationsListsToLoad = r.obtainTypedArray(conversationsListsResourceId);
|
||||
for (int i = 0; i < conversationsListsToLoad.length(); ++i) {
|
||||
ConversationCollection conversations = new ConversationCollection();
|
||||
Collection<String> ids = conversations.initialize(conversationListParser, readStringFromRaw(r, conversationsListsToLoad, i));
|
||||
world.conversationLoader.addIDs(conversationsListsToLoad.getResourceId(i, -1), ids);
|
||||
}
|
||||
conversationsListsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("ConversationListParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load monsters
|
||||
final MonsterTypeParser monsterTypeParser = new MonsterTypeParser(world.dropLists, world.actorConditionsTypes, loader, translationLoader);
|
||||
final TypedArray monstersToLoad = r.obtainTypedArray(monstersResourceId);
|
||||
for (int i = 0; i < monstersToLoad.length(); ++i) {
|
||||
world.monsterTypes.initialize(monsterTypeParser, readStringFromRaw(r, monstersToLoad, i));
|
||||
}
|
||||
monstersToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("MonsterTypeParser");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load maps
|
||||
TMXMapTranslator mapReader = new TMXMapTranslator();
|
||||
final TypedArray mapsToLoad = r.obtainTypedArray(mapsResourceId);
|
||||
for (int i = 0; i < mapsToLoad.length(); ++i) {
|
||||
final int mapResourceId = mapsToLoad.getResourceId(i, -1);
|
||||
final String mapName = r.getResourceEntryName(mapResourceId);
|
||||
mapReader.read(r, mapResourceId, mapName);
|
||||
}
|
||||
mapsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("TMXMapReader");
|
||||
world.maps.addAll(mapReader.transformMaps(world.monsterTypes, world.dropLists));
|
||||
loader.prepareAllMapTiles();
|
||||
mapReader = null;
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("mapReader.transformMaps");
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load graphics resources (icons and tiles)
|
||||
loader.flush();
|
||||
loader = null;
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("DynamicTileLoader");
|
||||
// ========================================================================
|
||||
|
||||
|
||||
// ========================================================================
|
||||
// Load worldmap coordinates
|
||||
WorldMapParser.read(r, R.xml.worldmap, world.maps, translationLoader);
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("WorldMapParser");
|
||||
// ========================================================================
|
||||
|
||||
translationLoader.close();
|
||||
|
||||
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
|
||||
long duration = System.currentTimeMillis() - start;
|
||||
L.log("ResourceLoader ran for " + duration + " ms.");
|
||||
}
|
||||
}
|
||||
|
||||
public static String readStringFromRaw(final Resources r, final TypedArray array, final int index) {
|
||||
return readStringFromRaw(r, array.getResourceId(index, -1));
|
||||
}
|
||||
public static String readStringFromRaw(final Resources r, final int resourceID) {
|
||||
InputStream is = r.openRawResource(resourceID);
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
||||
StringBuilder sb = new StringBuilder(1000);
|
||||
String line;
|
||||
try {
|
||||
while((line = br.readLine()) != null) sb.append(line);
|
||||
br.close();
|
||||
is.close();
|
||||
return sb.toString();
|
||||
} catch (IOException e) {
|
||||
L.log("ERROR: Reading from resource " + resourceID + " failed. " + e.toString());
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private static void prepareTilesets(DynamicTileLoader loader, int mTileSize) {
|
||||
final Size sz1x1 = new Size(1, 1);
|
||||
final Size sz2x1 = new Size(2, 1);
|
||||
final Size sz2x2 = new Size(2, 2);
|
||||
final Size sz2x3 = new Size(2, 3);
|
||||
final Size sz3x1 = new Size(3, 1);
|
||||
final Size sz6x1 = new Size(6, 1);
|
||||
final Size sz7x1 = new Size(7, 1);
|
||||
final Size sz20x12 = new Size(20, 12);
|
||||
final Size mapTileSize = new Size(16, 8);
|
||||
|
||||
loader.prepareTileset(R.drawable.char_hero, "char_hero", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.char_hero_maksiu_girl_01, "char_hero_maksiu_girl_01", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.char_hero_maksiu_boy_01, "char_hero_maksiu_boy_01", sz1x1, sz1x1, mTileSize);
|
||||
|
||||
loader.prepareTileset(R.drawable.ui_selections, "ui_selections", new Size(5, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.ui_quickslots, "ui_quickslots", sz2x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.ui_icon_equipment, "ui_icon_equipment", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.ui_splatters1, "ui_splatters1", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.ui_icon_immunity, "ui_icon_immunity", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_dynamic_placeholders, "map_dynamic_placeholders", new Size(10, 2), sz1x1, mTileSize);
|
||||
|
||||
loader.prepareTileset(R.drawable.actorconditions_1, "actorconditions_1", new Size(14, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_2, "actorconditions_2", sz3x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_japozero, "actorconditions_japozero", new Size(16, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.actorconditions_omi1, "actorconditions_omi1", sz2x1, sz1x1, mTileSize);
|
||||
/*INSERT_ACTORCONDITIONS_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.items_armours, "items_armours", new Size(14, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_weapons, "items_weapons", new Size(14, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_jewelry, "items_jewelry", new Size(14, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_consumables, "items_consumables", new Size(14, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_books, "items_books", new Size(11, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc, "items_misc", new Size(14, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_2, "items_misc_2", sz20x12, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_3, "items_misc_3", sz20x12, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_4, "items_misc_4", new Size(20, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_5, "items_misc_5", new Size(9, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_misc_6, "items_misc_6", new Size(9, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_reterski_1, "items_reterski_1", new Size(3, 10), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_tometik1, "items_tometik1", new Size(6, 10), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_tometik2, "items_tometik2", new Size(10, 10), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_tometik3, "items_tometik3", new Size(8, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_necklaces_1, "items_necklaces_1", new Size(10, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_weapons_2, "items_weapons_2", new Size(7, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_weapons_3, "items_weapons_3", new Size(13, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_armours_2, "items_armours_2", sz7x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_armours_3, "items_armours_3", new Size(10, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_rings_1, "items_rings_1", new Size(10, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_japozero, "items_japozero", new Size(16, 37), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_rijackson_1, "items_rijackson_1", new Size(5, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_g03_package_omi1, "items_g03_package_omi1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_consumables_omi1, "items_consumables_omi1", sz1x1, sz1x1, mTileSize);
|
||||
/*INSERT_ITEMS_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.monsters_armor1, "monsters_armor1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_cyclops, "monsters_cyclops", sz1x1, sz2x3, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_demon1, "monsters_demon1", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_demon2, "monsters_demon2", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_dogs, "monsters_dogs", sz7x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye1, "monsters_eye1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye2, "monsters_eye2", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye3, "monsters_eye3", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_eye4, "monsters_eye4", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ghost1, "monsters_ghost1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_hydra1, "monsters_hydra1", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_insects, "monsters_insects", sz6x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_karvis1, "monsters_karvis1", sz2x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_karvis2, "monsters_karvis2", new Size(9, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ld1, "monsters_ld1", new Size(20, 12), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_ld2, "monsters_ld2", new Size(20, 12), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_liches, "monsters_liches", new Size(4, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_mage, "monsters_mage", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_mage2, "monsters_mage2", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_man1, "monsters_man1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_men, "monsters_men", new Size(9, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_men2, "monsters_men2", new Size(10, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_misc, "monsters_misc", new Size(12, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rats, "monsters_rats", new Size(5, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_redshrike1, "monsters_redshrike1", sz7x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rltiles1, "monsters_rltiles1", new Size(20, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rltiles2, "monsters_rltiles2", new Size(20, 9), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rltiles3, "monsters_rltiles3", new Size(10, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rltiles4, "monsters_rltiles4", new Size(12, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rogue1, "monsters_rogue1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_skeleton1, "monsters_skeleton1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_skeleton2, "monsters_skeleton2", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_snakes, "monsters_snakes", sz6x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik1, "monsters_tometik1", new Size(10, 9), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik2, "monsters_tometik2", new Size(8, 10), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik3, "monsters_tometik3", new Size(6, 13), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik4, "monsters_tometik4", new Size(6, 13), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik5, "monsters_tometik5", new Size(6, 16), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik6, "monsters_tometik6", new Size(7, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik7, "monsters_tometik7", new Size(8, 11), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik8, "monsters_tometik8", new Size(7, 9), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik9, "monsters_tometik9", new Size(8, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_tometik10, "monsters_tometik10", new Size(6, 13), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_wraiths, "monsters_wraiths", sz3x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_zombie1, "monsters_zombie1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_zombie2, "monsters_zombie2", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_guynmart, "monsters_guynmart", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_maksiu1, "monsters_maksiu1", new Size(4, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_omi1, "monsters_omi1", sz2x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_omi1_b, "monsters_omi1_b", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_unknown, "monsters_unknown", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_arulirs, "monsters_arulirs", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_fatboy73, "monsters_fatboy73", new Size(20, 12), sz1x1, mTileSize);
|
||||
/*INSERT_NPCS_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.map_bed_1, "map_bed_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_border_1, "map_border_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_bridge_1, "map_bridge_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_bridge_2, "map_bridge_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_broken_1, "map_broken_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_1, "map_cavewall_1", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_2, "map_cavewall_2", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_3, "map_cavewall_3", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_4, "map_cavewall_4", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_chair_table_1, "map_chair_table_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_chair_table_2, "map_chair_table_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_crate_1, "map_crate_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cupboard_1, "map_cupboard_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_curtain_1, "map_curtain_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_entrance_1, "map_entrance_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_entrance_2, "map_entrance_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_1, "map_fence_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_2, "map_fence_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_3, "map_fence_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_4, "map_fence_4", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_1, "map_ground_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_2, "map_ground_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_3, "map_ground_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_4, "map_ground_4", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_5, "map_ground_5", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_6, "map_ground_6", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_7, "map_ground_7", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_8, "map_ground_8", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_house_1, "map_house_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_house_2, "map_house_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_indoor_1, "map_indoor_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_indoor_2, "map_indoor_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_kitchen_1, "map_kitchen_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_outdoor_1, "map_outdoor_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_pillar_1, "map_pillar_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_pillar_2, "map_pillar_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_plant_1, "map_plant_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_plant_2, "map_plant_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_rock_1, "map_rock_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_rock_2, "map_rock_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_1, "map_roof_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_2, "map_roof_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_3, "map_roof_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_shop_1, "map_shop_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_sign_ladder_1, "map_sign_ladder_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_table_1, "map_table_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_trail_1, "map_trail_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_1, "map_transition_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_2, "map_transition_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_3, "map_transition_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_4, "map_transition_4", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_5, "map_transition_5", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_tree_1, "map_tree_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_tree_2, "map_tree_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_1, "map_wall_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_2, "map_wall_2", new Size(15, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_3, "map_wall_3", new Size(15, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_4, "map_wall_4", new Size(15, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_window_1, "map_window_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_window_2, "map_window_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_guynmart, "map_guynmart", mapTileSize, sz1x1, mTileSize);
|
||||
/*INSERT_MAP_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.effect_blood4, "effect_blood4", new Size(7, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.effect_heal2, "effect_heal2", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.effect_poison1, "effect_poison1", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.effect_miss1, "effect_miss1", new Size(8, 2), sz1x1, mTileSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,10 +47,18 @@ public final class ResourceParserUtils {
|
||||
public static ConstRange parseConstRange(JSONObject o) throws JSONException {
|
||||
if (o == null) return null;
|
||||
|
||||
return new ConstRange(
|
||||
ConstRange ret = new ConstRange(
|
||||
o.getInt(JsonFieldNames.Range.max),
|
||||
o.optInt(JsonFieldNames.Range.min)
|
||||
);
|
||||
|
||||
if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
|
||||
if (ret.current > ret.max) {
|
||||
L.log("WARNING: Detected range where max value is lower than current value");
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static final ConstRange always = one;
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
@@ -21,8 +22,10 @@ import java.util.regex.Pattern;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Environment;
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
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.Constants;
|
||||
@@ -32,15 +35,26 @@ import com.gpl.rpg.AndorsTrail.util.L;
|
||||
|
||||
public final class Savegames {
|
||||
public static final int SLOT_QUICKSAVE = 0;
|
||||
public static final long DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED = -1;
|
||||
|
||||
private static long lastBackup = 0;
|
||||
|
||||
public static enum LoadSavegameResult {
|
||||
success
|
||||
, unknownError
|
||||
, savegameIsFromAFutureVersion
|
||||
, cheatingDetected
|
||||
}
|
||||
|
||||
public static boolean saveWorld(WorldContext world, Context androidContext, int slot, String displayInfo) {
|
||||
public static boolean saveWorld(WorldContext world, Context androidContext, int slot) {
|
||||
try {
|
||||
final String displayInfo = androidContext.getString(R.string.savegame_currenthero_displayinfo, world.model.player.getLevel(), world.model.player.getTotalExperience(), world.model.player.getGold());
|
||||
if (slot != SLOT_QUICKSAVE && !world.model.statistics.hasUnlimitedSaves()) {
|
||||
world.model.player.savedVersion++;
|
||||
}
|
||||
String id = world.model.player.id;
|
||||
long savedVersion = world.model.player.savedVersion;
|
||||
|
||||
// Create the savegame in a temporary memorystream first to ensure that the savegame can
|
||||
// be created correctly. We don't want to trash the user's file unneccessarily if there is an error.
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
@@ -51,18 +65,55 @@ public final class Savegames {
|
||||
FileOutputStream fos = getOutputFile(androidContext, slot);
|
||||
fos.write(savegame);
|
||||
fos.close();
|
||||
|
||||
if (!world.model.statistics.hasUnlimitedSaves()) {
|
||||
if (slot != SLOT_QUICKSAVE) {
|
||||
androidContext.deleteFile(Constants.FILENAME_SAVEGAME_QUICKSAVE);
|
||||
writeCheatCheck(androidContext, savedVersion, id);
|
||||
} else if (SystemClock.uptimeMillis() > lastBackup + 120000) {
|
||||
writeBackup(savegame, id);
|
||||
lastBackup = SystemClock.uptimeMillis();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
L.log("Error saving world: " + e.toString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeBackup(byte[] savegame, String playerId) throws IOException {
|
||||
File root = Environment.getExternalStorageDirectory();
|
||||
File cheatDetectionFolder = new File(root, Constants.CHEAT_DETECTION_FOLDER);
|
||||
if (!cheatDetectionFolder.exists()) cheatDetectionFolder.mkdir();
|
||||
File backupFile = new File(cheatDetectionFolder, playerId + "X");
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(backupFile);
|
||||
fileOutputStream.write(savegame);
|
||||
fileOutputStream.close();
|
||||
}
|
||||
|
||||
public static LoadSavegameResult loadWorld(WorldContext world, ControllerContext controllers, Context androidContext, int slot) {
|
||||
try {
|
||||
FileHeader fh = quickload(androidContext, slot);
|
||||
if(fh == null) {
|
||||
return LoadSavegameResult.unknownError;
|
||||
}
|
||||
if (!fh.hasUnlimitedSaves && slot != SLOT_QUICKSAVE && triedToCheat(androidContext, fh)) {
|
||||
return LoadSavegameResult.cheatingDetected;
|
||||
}
|
||||
|
||||
FileInputStream fos = getInputFile(androidContext, slot);
|
||||
LoadSavegameResult result = loadWorld(androidContext.getResources(), world, controllers, fos, fh);
|
||||
fos.close();
|
||||
if (result == LoadSavegameResult.success && slot != SLOT_QUICKSAVE && !world.model.statistics.hasUnlimitedSaves()) {
|
||||
// save to the quicksave slot before deleting the file
|
||||
if (!saveWorld(world, androidContext, SLOT_QUICKSAVE)) {
|
||||
return LoadSavegameResult.unknownError;
|
||||
}
|
||||
getSlotFile(slot).delete();
|
||||
writeCheatCheck(androidContext, DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED, fh.playerId);
|
||||
}
|
||||
return result;
|
||||
} catch (IOException e) {
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
|
||||
@@ -76,6 +127,47 @@ public final class Savegames {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean triedToCheat(Context androidContext, FileHeader fh) throws IOException {
|
||||
long savedVersionToCheck = 0;
|
||||
File root = Environment.getExternalStorageDirectory();
|
||||
File cheatDetectionFolder = new File(root, Constants.CHEAT_DETECTION_FOLDER);
|
||||
if (!cheatDetectionFolder.exists()) cheatDetectionFolder.mkdir();
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, fh.playerId);
|
||||
if (cheatDetectionFile.exists()) {
|
||||
FileInputStream fileInputStream = new FileInputStream(cheatDetectionFile);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
dataInputStream.close();
|
||||
fileInputStream.close();
|
||||
}
|
||||
|
||||
if (savedVersionToCheck == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (androidContext.getFileStreamPath(fh.playerId).exists()) {
|
||||
FileInputStream fileInputStream = androidContext.openFileInput(fh.playerId);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
if (cheatDetection.savedVersion == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED) {
|
||||
savedVersionToCheck = DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED;
|
||||
}
|
||||
else if (cheatDetection.savedVersion > savedVersionToCheck) {
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
}
|
||||
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
|
||||
L.log("Internal cheatcheck file savedVersion: " + cheatDetection.savedVersion);
|
||||
}
|
||||
|
||||
dataInputStream.close();
|
||||
fileInputStream.close();
|
||||
}
|
||||
|
||||
return (savedVersionToCheck == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED || fh.savedVersion < savedVersionToCheck);
|
||||
}
|
||||
|
||||
private static FileOutputStream getOutputFile(Context androidContext, int slot) throws IOException {
|
||||
if (slot == SLOT_QUICKSAVE) {
|
||||
return androidContext.openFileOutput(Constants.FILENAME_SAVEGAME_QUICKSAVE, Context.MODE_PRIVATE);
|
||||
@@ -96,7 +188,8 @@ public final class Savegames {
|
||||
return new FileInputStream(getSlotFile(slot));
|
||||
}
|
||||
}
|
||||
private static File getSlotFile(int slot) {
|
||||
|
||||
public static File getSlotFile(int slot) {
|
||||
File root = getSavegameDirectory();
|
||||
return new File(root, Constants.FILENAME_SAVEGAME_FILENAME_PREFIX + slot);
|
||||
}
|
||||
@@ -108,7 +201,12 @@ public final class Savegames {
|
||||
|
||||
public static void saveWorld(WorldContext world, OutputStream outStream, String displayInfo) throws IOException {
|
||||
DataOutputStream dest = new DataOutputStream(outStream);
|
||||
FileHeader.writeToParcel(dest, world.model.player.getName(), displayInfo, world.model.player.iconID);
|
||||
FileHeader.writeToParcel(dest, world.model.player.getName(),
|
||||
displayInfo, world.model.player.iconID,
|
||||
world.model.statistics.isDead(),
|
||||
world.model.statistics.hasUnlimitedSaves(),
|
||||
world.model.player.id,
|
||||
world.model.player.savedVersion);
|
||||
world.maps.writeToParcel(dest, world);
|
||||
world.model.writeToParcel(dest);
|
||||
dest.close();
|
||||
@@ -156,6 +254,24 @@ public final class Savegames {
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeCheatCheck(Context androidContext, long savedVersion, String playerId) throws IOException {
|
||||
File root = Environment.getExternalStorageDirectory();
|
||||
File cheatDetectionFolder = new File(root, Constants.CHEAT_DETECTION_FOLDER);
|
||||
if (!cheatDetectionFolder.exists()) cheatDetectionFolder.mkdir();
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, playerId);
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(cheatDetectionFile);
|
||||
DataOutputStream dataOutputStream = new DataOutputStream(fileOutputStream);
|
||||
CheatDetection.writeToParcel(dataOutputStream, savedVersion);
|
||||
dataOutputStream.close();
|
||||
fileOutputStream.close();
|
||||
|
||||
fileOutputStream = androidContext.openFileOutput(playerId, Context.MODE_PRIVATE);
|
||||
dataOutputStream = new DataOutputStream(fileOutputStream);
|
||||
CheatDetection.writeToParcel(dataOutputStream, savedVersion);
|
||||
dataOutputStream.close();
|
||||
fileOutputStream.close();
|
||||
}
|
||||
|
||||
private static final Pattern savegameFilenamePattern = Pattern.compile(Constants.FILENAME_SAVEGAME_FILENAME_PREFIX + "(\\d+)");
|
||||
public static List<Integer> getUsedSavegameSlots() {
|
||||
try {
|
||||
@@ -178,15 +294,38 @@ public final class Savegames {
|
||||
}
|
||||
}
|
||||
|
||||
private static final class CheatDetection {
|
||||
public final int fileversion;
|
||||
public final long savedVersion;
|
||||
|
||||
// ====== PARCELABLE ===================================================================
|
||||
|
||||
public CheatDetection(DataInputStream src) throws IOException {
|
||||
this.fileversion = src.readInt();
|
||||
this.savedVersion = src.readLong();
|
||||
}
|
||||
|
||||
public static void writeToParcel(DataOutputStream dest, long savedVersion) throws IOException {
|
||||
dest.writeInt(AndorsTrailApplication.CURRENT_VERSION);
|
||||
dest.writeLong(savedVersion);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static final class FileHeader {
|
||||
public final int fileversion;
|
||||
public final String playerName;
|
||||
public final String displayInfo;
|
||||
public final int iconID;
|
||||
public boolean skipIcon = false;
|
||||
|
||||
public final boolean isDead;
|
||||
public final boolean hasUnlimitedSaves;
|
||||
public final String playerId;
|
||||
public final long savedVersion;
|
||||
|
||||
public String describe() {
|
||||
return playerName + ", " + displayInfo;
|
||||
return (fileversion == AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION ? "(D) " : "") + playerName + ", " + displayInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -203,9 +342,10 @@ public final class Savegames {
|
||||
this.playerName = null;
|
||||
this.displayInfo = null;
|
||||
}
|
||||
if (fileversion >= 43 && !skipIcon) {
|
||||
|
||||
if (fileversion >= 43) {
|
||||
int id = src.readInt();
|
||||
if (id > TileManager.LAST_HERO) {
|
||||
if (skipIcon || id > TileManager.LAST_HERO) {
|
||||
this.iconID = TileManager.CHAR_HERO_0;
|
||||
this.skipIcon = true;
|
||||
} else {
|
||||
@@ -214,13 +354,29 @@ public final class Savegames {
|
||||
} else {
|
||||
this.iconID = TileManager.CHAR_HERO_0;
|
||||
}
|
||||
|
||||
if (fileversion >= 49) {
|
||||
this.isDead = src.readBoolean();
|
||||
this.hasUnlimitedSaves = src.readBoolean();
|
||||
this.playerId = src.readUTF();
|
||||
this.savedVersion = src.readLong();
|
||||
} else {
|
||||
this.isDead = false;
|
||||
this.hasUnlimitedSaves = true;
|
||||
this.playerId = "";
|
||||
this.savedVersion = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeToParcel(DataOutputStream dest, String playerName, String displayInfo, int iconID) throws IOException {
|
||||
public static void writeToParcel(DataOutputStream dest, String playerName, String displayInfo, int iconID, boolean isDead, boolean hasUnlimitedSaves, String playerId, long savedVersion) throws IOException {
|
||||
dest.writeInt(AndorsTrailApplication.CURRENT_VERSION);
|
||||
dest.writeUTF(playerName);
|
||||
dest.writeUTF(displayInfo);
|
||||
dest.writeInt(iconID);
|
||||
dest.writeBoolean(isDead);
|
||||
dest.writeBoolean(hasUnlimitedSaves);
|
||||
dest.writeUTF(playerId);
|
||||
dest.writeLong(savedVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ public final class ConstRange {
|
||||
}
|
||||
public String toMinMaxAbsString() {
|
||||
if (isMax()) return Integer.toString(Math.abs(max));
|
||||
else if (current < 0) return Math.abs(max) + "-" + Math.abs(current);
|
||||
else return Math.abs(current) + "-" + Math.abs(max);
|
||||
}
|
||||
public boolean isMax() { return max == current; }
|
||||
|
||||
@@ -45,7 +45,7 @@ public final class SkillListAdapter extends ArrayAdapter<SkillInfo> {
|
||||
Collections.sort(result, new Comparator<SkillInfo>() {
|
||||
@Override
|
||||
public int compare(SkillInfo a, SkillInfo b) {
|
||||
return a.id.ordinal() - b.id.ordinal();
|
||||
return a.position - b.position;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
@@ -63,7 +63,7 @@ public final class SkillListAdapter extends ArrayAdapter<SkillInfo> {
|
||||
Collections.sort(result, new Comparator<SkillInfo>() {
|
||||
@Override
|
||||
public int compare(SkillInfo a, SkillInfo b) {
|
||||
return a.id.ordinal() - b.id.ordinal();
|
||||
return a.position - b.position;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
@@ -158,11 +158,22 @@ public final class SkillListAdapter extends ArrayAdapter<SkillInfo> {
|
||||
case specializationDualWield: return R.string.skill_shortdescription_specialization_dualwield;
|
||||
case specialization2hand: return R.string.skill_shortdescription_specialization_2hand;
|
||||
case specializationWeaponShield: return R.string.skill_shortdescription_specialization_weapon_shield;
|
||||
case weaponProficiencyPole: return R.string.skill_shortdescription_weapon_prof_pole;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public void sortDefault(){
|
||||
Comparator<SkillInfo> comparatorName = new Comparator<SkillInfo>() {
|
||||
@Override
|
||||
public int compare(SkillInfo a, SkillInfo b) {
|
||||
return a.position - b.position;
|
||||
}
|
||||
};
|
||||
this.sort(comparatorName);
|
||||
}
|
||||
|
||||
public void sortByName(){
|
||||
Comparator<SkillInfo> comparatorName = new Comparator<SkillInfo>() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user