Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…aurs

# Conflicts:
#	MazesAndMinotaurs/app/src/main/java/com/example/cis/mazeminotaurs/DetailedWeaponAdapter.java
#	MazesAndMinotaurs/app/src/main/java/com/example/cis/mazeminotaurs/NewCharacter/CreateCharacter.java
#	MazesAndMinotaurs/app/src/main/res/layout/fragment_create_character.xml
  • Loading branch information
JayTSmith committed Oct 13, 2017
2 parents a175d94 + f73d650 commit c18f71d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ else if(mCurrentCharacter.getCurrentWeapon().getWeaponType() == R.string.missile
mAttackType = getString(mCurrentCharacter.getCurrentWeapon().getWeaponType());
mAttackRoll1 = rollDice.roll(20);
mAttackRoll2 = rollDice.roll(20);
mDamage1 = rollDice.roll(6);
mDamage2 = rollDice.roll(6);
mDamage1 = rollDice.roll(mCurrentCharacter.getCurrentWeapon().getDamageDie());
mDamage2 = rollDice.roll(mCurrentCharacter.getCurrentWeapon().getDamageDie());
mTotal1 = mAttackRoll1 + mMod;
mTotal2 = mAttackRoll2 + mMod;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

import com.example.cis.mazeminotaurs.character.PlayerCharacter;
import com.example.cis.mazeminotaurs.character.SaveAndLoadDialog;
Expand Down Expand Up @@ -204,17 +203,7 @@ else if(mSheetPlayerCharacter.getCurrentWeapon().getWeaponType() == R.string.mel
mAttackButton.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
//just for testing, replace these with calls to character methods
if (mSheetPlayerCharacter.getCurrentWeapon() != null) {
int weaponType = mSheetPlayerCharacter.getCurrentWeapon().getWeaponType();
boolean woc = false;
if (mSheetPlayerCharacter.getCharClass() instanceof Warrior) {
woc = ((Warrior) mSheetPlayerCharacter.getCharClass()).getWeaponOfChoice() == mSheetPlayerCharacter.getCurrentWeapon();
} else if (mSheetPlayerCharacter.getCharClass() instanceof Specialist) {
woc = ((Specialist) mSheetPlayerCharacter.getCharClass()).getWeaponOfChoice() == mSheetPlayerCharacter.getCurrentWeapon();
}
onAttackClick(weaponType, woc);
}
onAttackClick();
}
});

Expand Down Expand Up @@ -343,21 +332,7 @@ public void onScoreLongClick(Score skill, String name) {
dialog.show(fm, ROLL_RESULT);
}

public void onAttackClick(int attackType, boolean wocEquipped){
int modifier;
int attackRoll1 = rollDice.roll(20);
int attackRoll2 = rollDice.roll(20);
int damageRoll1 = rollDice.roll(6);
int damageRoll2 = rollDice.roll(6);
if (attackType == R.string.melee){
modifier = mSheetPlayerCharacter.getMeleeMod();
}
else if (attackType == R.string.missile){
modifier = mSheetPlayerCharacter.getMeleeMod();
}
else{
modifier = 0;
}
public void onAttackClick(){
FragmentManager fm = getFragmentManager();
AttackResultFragment dialog = AttackResultFragment.newInstance(mCurrentCharacterIndex);
dialog.show(fm, ROLL_RESULT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,17 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;

import com.example.cis.mazeminotaurs.CharacterSheetFragment;
import com.example.cis.mazeminotaurs.DetailedWeaponAdapter;
import com.example.cis.mazeminotaurs.Equipment;
import com.example.cis.mazeminotaurs.Portfolio;
import com.example.cis.mazeminotaurs.R;
import com.example.cis.mazeminotaurs.Weapon;
import com.example.cis.mazeminotaurs.character.PlayerCharacter;
import com.example.cis.mazeminotaurs.character.classes.BaseClass;
import com.example.cis.mazeminotaurs.character.stats.Score;

import java.util.ArrayList;

/**
* Created by ckling on 4/10/17.
*/
Expand All @@ -54,7 +45,7 @@ public class CreateCharacter extends Fragment {
Button mPVButton;
Button mInitButton;

Spinner mWeaponNameSpinner;
Button mWeaponNameButton;
Button mWeaponTypeButton;

public CreateCharacter() {
Expand Down Expand Up @@ -112,29 +103,7 @@ public void afterTextChanged(Editable editable) {
mMFButton = (Button) rootView.findViewById(R.id.mystic_fortitude_button);
mPVButton = (Button) rootView.findViewById(R.id.physical_vigor_button);
mInitButton = (Button) rootView.findViewById(R.id.initiative_modifier_button);
mWeaponNameSpinner = (Spinner) rootView.findViewById(R.id.equipped_weapon_spinner);

final ArrayList<Weapon> weps = new ArrayList<>();
for (Equipment equipment : mBaseClass.getStartGear()) {
if (equipment instanceof Weapon) {
weps.add((Weapon) equipment);
}
}
DetailedWeaponAdapter adapter = new DetailedWeaponAdapter(getContext(), weps);
mWeaponNameSpinner.setAdapter(adapter);

mWeaponNameSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
mWeaponTypeButton.setText(weps.get(i).getWeaponType());
}

@Override
public void onNothingSelected(AdapterView<?> adapterView) {

}
});

mWeaponNameButton = (Button) rootView.findViewById(R.id.equipped_weapon_spinner);
mWeaponTypeButton = (Button) rootView.findViewById(R.id.attack_button);

// Confirm button
Expand Down Expand Up @@ -167,9 +136,11 @@ private void updateStatButtons() {
mPVButton.setText(Integer.toString(character.getPhysicalVigor()));
mInitButton.setText(Integer.toString(character.getInitiative()));
if (character.getCurrentWeapon() != null) {
mWeaponNameButton.setText(character.getCurrentWeapon().getResId());
mWeaponTypeButton.setText(character.getCurrentWeapon().getWeaponType());
}
else {
mWeaponNameButton.setText("-");
mWeaponTypeButton.setText("-");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
android:textAlignment="center"
android:textSize="24sp"/>

<Spinner
<Button
android:id="@+id/equipped_weapon_spinner"
android:layout_width="63dp"
android:layout_column="2"
Expand Down
Binary file modified MazesAndMinotaurs/instapk.log
Binary file not shown.

0 comments on commit c18f71d

Please sign in to comment.