-
Notifications
You must be signed in to change notification settings - Fork 1
API documentation
This is documentation of fields and method in our program. BE CAREFUL ABOUT STATIC AND NON-STATIC FIELD AND METHOD.
public static void waitingTime(int t)
makes the Program stops for a while for amount
t
. t = 1000 is 1 second.
Returns nothing
public static int randomNum(int a, int b)
returns a random number greater than equal to a and less than equal to b thus inclusive.
Returns
int x
that a ≤ x ≤ b
public static boolean percentProb(int a)
input a% and results in
true
orfalse
based on the probability. Iftrue
, within the probability. Iffalse
, outside the probability.
Returns
boolean
type :true
orfalse
public static char scanChar()
scanning a character typed from keyboard
Returns
char
type
public static String scanString()
scanning a
String
value from keyboard
Returns
String
type
public static int scanInt()
scanning a
int
value from keyboard
Returns
int
type
public static void stop()
just Program needed for scanner. NOT ACTUALLY USED
Returns nothing
public static ArrayList<String> deepCopy(ArrayList<String> list)
Makes a deep coy of string arraylist. Makes the reference address different
Returns
ArrayList<String>
type
static String name; //Character name
static String classType; //Character class
static int lv; //level
static int age; // age
static int str; //strength
static int wis; //wisdom
static int agi; //agility
static int hpMax; //maximum HP
static int hpNow; //current HP
static int mpMax; //maximum MP
static int mpNow; //current MP
static int coin; //money
static int currentPart; //current part in the story
static String currentState; //tells what the character is doing idle, fighting, shopping, etc.
public static void makeStats(String nameChoice, String classTypeChoice, int lvChoice, int ageChoice, int strChoice, int wisChoice, int agiChoice, int hpMaxChoice, int hpNowChoice, int mpMaxChoice, int mpNowChoice, int atkChoice, int coinChoice)
declaring field, creating a character
returns nothing
public static void statPage()
printing out stats of the character
Nothing
public static void healHP(int healAmount)
healing HP using a potion, skill, etc. Int heal amount is needed and it will heal the character in that amount. If the healing amount is above the healing amount, the current hp will be set to max.
nothing
public static void healHP(int healAmount)
healing MP using a potion, skill, etc. Int heal amount is needed and it will heal the character in that amount. If the healing amount is above the healing amount, the current mp will be set to max.
nothing
public static int normalAttackDamageCounter()
counts damage/attack amount of the character and returns the amount of damage
int
public static ArrayList<ArrayList<String>> weapon = new ArrayList<ArrayList<String>>();
//arraylist that stores weapons
public static ArrayList<ArrayList<String>> potion = new ArrayList<ArrayList<String>>();
//arraylist that stores potions
public static ArrayList<ArrayList<String>> otherItem = new ArrayList<ArrayList<String>>();
//arraylist that stores items
public static final int WEAPONID = 0;
public static final int WEAPONNAME = 1;
public static final int WEAPONTYPE = 2;
public static final int WEAPONDAMAGE = 3;
public static final int WEAPONCURRENTDURABILITY = 4;
public static final int WEAPONDURABILITY = 5;
public static final int WEAPONSPECIAL = 6;
public static final int WEAPONSPECIALTYPE = 7;
public static final int WEAPONDESCRIPTION = 8;
public static final int WEAPONSTATE = 9;
public static final int POTIONID = 0;
public static final int POTIONNAME = 1;
public static final int POTIONTYPE = 2;
public static final int POTIONDHP = 3;
public static final int POTIONMP = 4;
public static final int POTIONDESCRIPTION = 5;
public static final int POTIONQUANTITY = 6;
public static final int OTHERITEMID = 0;
public static final int OTHERITEMNAME = 1;
public static final int OTHERITEMTYPE = 2;
public static final int OTHERITEMQUANTITY = 3;
public static int currentEquipedWeapon = -1;
//int value that shows what number(item ID) of Weapon is equiped. -1 if not equipped
public static void setInventoryItem (int itemID, int quantity)
add certain amount of item with certain quantity. Potions are stackable. Just type in the ID and number of item
Nothing
public static boolean haveItem(int ID)
Search for inventory if the user has item with specific item ID. Returns
true
if present,false
if not present
boolean
public static int haveItemNum(int ID)
solely used only for potion and stackable item so item from ID 3000 and above. Returns the number of position of the item where it is present. Returns -1 if not present
int
public static void showInventory()
Text UI for inventory. RECOMMEND USING THIS FOR UI FOR INVENTORY.
Nothing
public static void getWeapons()
UI for displaying weapons
nothing
public static void getPotions()
UI for displaying potions
Nothing
public static void getOtherItem()
UI for displaying other items
Nothing
public static void printSpecificWeapon(int inventoryItemID)
print specific weapon detail based on the order number in arraylist
nothing
public static void printSpecificPotion(int inventoryItemID)
print specific potion detail based on the order number in arraylist
nothing
public static void printSpecificOtherItem(int inventoryItemID)
print specific item detail based on the order number in arraylist
Nothing
public static void updateEquiped()
check which number(position) of weapon is equiped. Returns -1 if not equiped.
Nothing
public static void equipItem(int itemEquipNum, int itemType)
equips item in position itemEquipNum. itemType: 1= weapon, 2=armor
Nothing
public static void usePotion()
UI for using potion. RECOMMEND USING
Nothing
public static String getWeaponName(int inventoryItemID)
get name of the potion. If invetoryItemID is -1, returns "null"
String
public static void setWeaponName(int inventoryItemID, String changedName)
sets name of the weapon of ID into changedName. If invetoryItemID is -1 nothing happens
Nothing
public static int getWeaponDamage(int inventoryItemID)
returns the damage of weapon with specified ID
int
public static void setWeaponDamage(int inventoryItemID, int changedDamage)
set the weapon damage into changedDamage
nothing
public static int getWeaponCurrentDurability(int inventoryItemID)
gets current durabiltiy of the weapon
int