Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Fixes #11

Merged
merged 27 commits into from
Apr 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
812c53d
Started to add the character class into the Game.
Mar 30, 2017
d77d250
+ Added references in game_references.xml for
Mar 31, 2017
24335df
Actually pushed the files
Mar 31, 2017
43fdacc
Started to add the character class into the Game.
Mar 30, 2017
bc8c450
+ Added references in game_references.xml for
Mar 31, 2017
1c12e9c
Actually pushed the files
Mar 31, 2017
04cc798
Merge branch 'master' of https://github.com/JayTSmith/mazes_and_minot…
Apr 1, 2017
9a6dee9
+ Changed the code to use AttributeScores rather than just raw Integers.
Apr 4, 2017
03c44fd
+ Added Money enum
Apr 5, 2017
a87431e
Merge https://github.com/CIS-Extra/mazes_and_minotaurs
Apr 5, 2017
59b3722
+ Changed Character class to PlayerCharacter
Apr 5, 2017
da35948
Merge https://github.com/CIS-Extra/mazes_and_minotaurs
Apr 7, 2017
4a3abbc
+ Changed getCoreStatScore to getScore
Apr 7, 2017
83957e3
+ Modified LevelUp and LevelDown to restore the proper scores rather …
Apr 10, 2017
7d1ef55
Merge https://github.com/CIS-Extra/mazes_and_minotaurs
Apr 13, 2017
0d2bde8
Removed the EffectiveLevel property from BaseClass
Apr 13, 2017
250c314
+ Added methods for saving throws in PlayerCharacter.java
Apr 16, 2017
904454a
Merge https://github.com/CIS-Extra/mazes_and_minotaurs
Apr 16, 2017
ac9ee74
Merge https://github.com/CIS-Extra/mazes_and_minotaurs
Apr 18, 2017
e8dc8ed
Merge branch 'master' of https://github.com/JayTSmith/mazes_and_minot…
Apr 18, 2017
86f56e6
+ Added the Equipment functionality to Barbarian
Apr 20, 2017
a2ec89b
+ Added the equipment functionality to the PlayerCharacter
Apr 20, 2017
6683563
+ Fixed more typos
Apr 20, 2017
28fde6c
+ Changed Portfolio to work with the new method of Character Creation
Apr 20, 2017
22d86c8
Merge https://github.com/CIS-Extra/mazes_and_minotaurs
Apr 20, 2017
4a2a6d1
Merge https://github.com/CIS-Extra/mazes_and_minotaurs
Apr 24, 2017
dcf49f4
+ Changed mWeapon to mCurrentWeapon
Apr 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 29 additions & 65 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public void onCreate(Bundle savedInstanceState){
mPortfolio = Portfolio.get();
mCurrentCharacter = mPortfolio.getPlayerCharacter(mCurrentCharacterIndex);

if(mCurrentCharacter.getWeapon().getWeaponType() == R.string.melee){
if(mCurrentCharacter.getCurrentWeapon().getWeaponType() == R.string.melee){
mMod = mCurrentCharacter.getMeleeMod();
}
else if(mCurrentCharacter.getWeapon().getWeaponType() == R.string.missile){
else if(mCurrentCharacter.getCurrentWeapon().getWeaponType() == R.string.missile){
mMod = mCurrentCharacter.getMissileMod();
}
else {//this should never happen
mMod = -10;
}
mAttackType = getString(mCurrentCharacter.getWeapon().getWeaponType());
mAttackType = getString(mCurrentCharacter.getCurrentWeapon().getWeaponType());
mAttackRoll1 = Util.roll(20);
mAttackRoll2 = Util.roll(20);
mDamage1 = Util.roll(6);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ public void onClick(View v){
});

mAttackType = (TextView) rootView.findViewById(R.id.attack_title_view);
mAttackType.setText(mSheetPlayerCharacter.getWeapon().getWeaponType());
mAttackType.setText(mSheetPlayerCharacter.getCurrentWeapon().getWeaponType());

mAttackButton = (Button) rootView.findViewById(R.id.attack_button);
if(mSheetPlayerCharacter.getWeapon().getWeaponType() == R.string.melee) {
if(mSheetPlayerCharacter.getCurrentWeapon().getWeaponType() == R.string.melee) {
mAttackButton.setText(Integer.toString(mSheetPlayerCharacter.getMeleeMod()));
}
else{
Expand All @@ -140,7 +140,7 @@ public void onClick(View v){
@Override
public void onClick(View v){
//just for testing, replace these with calls to character methods
int weaponType = mSheetPlayerCharacter.getWeapon().getWeaponType();
int weaponType = mSheetPlayerCharacter.getCurrentWeapon().getWeaponType();
boolean woc = true;
onAttackClick(weaponType, woc);
}
Expand All @@ -149,7 +149,7 @@ public void onClick(View v){
mEquippedWeaponButton = (Button) rootView.findViewById(R.id.equipped_weapon_button);
//Get equipped weapon from character Class
//int equippedWeaponID = R.string.barb_axe;
Weapon equippedWeapon = mSheetPlayerCharacter.getWeapon();
Weapon equippedWeapon = mSheetPlayerCharacter.getCurrentWeapon();
Log.i(TAG, equippedWeapon.toString());
int equippedWeaponID = equippedWeapon.getResId();
mEquippedWeaponButton.setText(equippedWeaponID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class PlayerCharacter {
/**
* The character's equipped weapon.
*/
private Weapon mWeapon;
private Weapon mCurrentWeapon;

/**
* The helmet that the character is currently wearing.
Expand Down Expand Up @@ -306,26 +306,26 @@ public void setShield(Armor shield) {
mShield = shield;
}

public Weapon getWeapon() {
return mWeapon;
public Weapon getCurrentWeapon() {
return mCurrentWeapon;
}

public void setWeapon(Weapon weapon) {
mWeapon = weapon;
public void setCurrentWeapon(Weapon currentWeapon) {
mCurrentWeapon = currentWeapon;
}

/**
* Checks if the current weapon in mWeapon is a weapon of choice.
* Checks if the current weapon in mCurrentWeapon is a weapon of choice.
* @return true if the weapon is the same as the CharClass's weapon of choice else false
*/
public boolean isWeaponOfChoiceEquipped(){
if (!(getCharClass() instanceof Magician)) {
if (getCharClass() instanceof Warrior) {
Warrior warrior = (Warrior) getCharClass();
return warrior.getWeaponOfChoice().getResId() == getWeapon().getResId();
return warrior.getWeaponOfChoice().getResId() == getCurrentWeapon().getResId();
} else {
Specialist specialist = (Specialist) getCharClass();
return specialist.getWeaponOfChoice().getResId() == getWeapon().getResId();
return specialist.getWeaponOfChoice().getResId() == getCurrentWeapon().getResId();
}
}
return false;
Expand Down Expand Up @@ -398,6 +398,19 @@ public void setCharClass(BaseClass aClass) {
public void initializeClass(){
getMoney().put(Money.SILVER, getCharClass().getStartMoney());
getInventory().addAll(getCharClass().getStartGear());
setCurrentWeapon(getWeapons().get(0));
}

public ArrayList<Weapon> getWeapons(){
ArrayList<Weapon> weaponsFound = new ArrayList<>();

for (Equipment equipment: getInventory()) {
if (equipment instanceof Weapon) {
weaponsFound.add((Weapon) equipment);
}
}

return weaponsFound;
}

public int getAge() {
Expand Down
Loading