Merge branch 'poleweapon' into nut_arulir_mountain

This commit is contained in:
Gonk
2019-10-30 22:50:32 +01:00
10 changed files with 82 additions and 57 deletions

View File

@@ -97,6 +97,13 @@
"size":"large",
"inventorySlot":"weapon"
},
{
"id":"pole",
"name":"Pole weapon",
"actionType":"equip",
"size":"large",
"inventorySlot":"weapon"
},
{
"id":"buckler",
"name":"Buckler",

View File

@@ -5,12 +5,5 @@
"actionType":"equip",
"size":"std",
"inventorySlot":"weapon"
},
{
"id":"scythe",
"name":"Scythe",
"actionType":"equip",
"size":"large",
"inventorySlot":"weapon"
}
]

View File

@@ -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":{

View File

@@ -605,6 +605,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>
@@ -622,6 +623,7 @@
<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>
@@ -649,6 +651,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>

View File

@@ -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 "";
}

View File

@@ -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();

View File

@@ -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()) {

View File

@@ -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;
}
}

View File

@@ -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() {

View File

@@ -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