Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
166 changes: 83 additions & 83 deletions res/weapons.txt
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
#Name Type Range Mt Hit Crit Uses Worth Effect Pref Mod
Tree Branch Sword 1 1 100 0 20 1 - - -
Iron Sword Sword 1 5 90 0 23 460 - - -
Steel Sword Sword 1 8 75 0 15 600 - - -
Silver Sword Sword 1 13 80 0 10 1500 - - -
Killing Edge Sword 1 9 75 30 10 1300 - - -
Armorslayer Sword 1 8 80 0 9 1260 Armor - -
Longsword Sword 1 6 85 0 9 1260 Mount - -
Lancereaver Sword 1 9 75 5 7 1800 - - -
Brave Sword Sword 1 9 75 0 15 8000 - - -
Audhulma Sword 1 18 85 0 15 10000 - - Res 5
Wo Dao Sword 1 8 75 35 10 1200 - - -
Durandal Sword 1 17 90 0 10 - - Eliwood Str 5
Sol Katti Sword 1 12 95 25 15 - Mount Lyn Res 5
Sieglinde Sword 1 16 90 0 15 - - Eirika Str 5
Falchion Sword 1 15 90 20 15 - - Marth Skl 5
Ragnell Sword 1-2 14 85 0 10 - - Ike Def 5
Sealed Sword Sword 1-2 16 95 10 10 - - Roy Res 5
Log Lance 1 1 100 0 20 1 - - -
Iron Lance Lance 1 7 80 0 22 360 - - -
Steel Lance Lance 1 10 70 0 15 480 - - -
Silver Lance Lance 1 14 75 0 10 1200 - - -
Javelin Lance 1-2 6 65 0 10 400 - - -
Short Spear Lance 1-2 9 60 0 9 900 - - -
Killer Lance Lance 1 10 70 30 10 1200 - - -
Heavy Spear Lance 1 9 70 0 8 1200 Armor - -
Horseslayer Lance 1 7 70 0 8 1040 Mount - -
Axereaver Lance 1 10 70 5 7 1950 - - -
Brave Lance Lance 1 10 70 0 15 7500 - - -
Gradivus Lance 1-2 15 85 0 15 10000 - - Def 5
Siegmund Lance 1 17 80 0 15 - - Ephraim Str 5
#Name Type Range Mt Hit Crit Uses Worth Effect Pref Mod Class
Tree Branch Sword 1 1 100 0 20 1 - - - -
Iron Sword Sword 1 5 90 0 23 460 - - - -
Steel Sword Sword 1 8 75 0 15 600 - - - -
Silver Sword Sword 1 13 80 0 10 1500 - - - -
Killing Edge Sword 1 9 75 30 10 1300 - - - Killer
Armorslayer Sword 1 8 80 0 9 1260 Armor - - Slayer
Longsword Sword 1 6 85 0 9 1260 Mount - - Slayer
Lancereaver Sword 1 9 75 5 7 1800 - - - Reaver
Brave Sword Sword 1 9 75 0 15 8000 - - - Brave
Audhulma Sword 1 18 85 0 15 10000 - - Res 5 Legend
Wo Dao Sword 1 8 75 35 10 1200 - - - Killer
Durandal Sword 1 17 90 0 10 - - Eliwood Str 5 -
Sol Katti Sword 1 12 95 25 15 - Mount Lyn Res 5 -
Sieglinde Sword 1 16 90 0 15 - - Eirika Str 5 -
Falchion Sword 1 15 90 20 15 - - Marth Skl 5 -
Ragnell Sword 1-2 14 85 0 10 - - Ike Def 5 -
Sealed Sword Sword 1-2 16 95 10 10 - - Roy Res 5 -
Log Lance 1 1 100 0 20 1 - - - -
Iron Lance Lance 1 7 80 0 22 360 - - - -
Steel Lance Lance 1 10 70 0 15 480 - - - -
Silver Lance Lance 1 14 75 0 10 1200 - - - -
Javelin Lance 1-2 6 65 0 10 400 - - - Throw
Short Spear Lance 1-2 9 60 0 9 900 - - - Throw
Killer Lance Lance 1 10 70 30 10 1200 - - - Killer
Heavy Spear Lance 1 9 70 0 8 1200 Armor - - Slayer
Horseslayer Lance 1 7 70 0 8 1040 Mount - - Slayer
Axereaver Lance 1 10 70 5 7 1950 - - - Reaver
Brave Lance Lance 1 10 70 0 15 7500 - - - Brave
Gradivus Lance 1-2 15 85 0 15 10000 - - Def 5 Legend
Siegmund Lance 1 17 80 0 15 - - Ephraim Str 5 -
#
#Name Type Range Mt Hit Crit Uses Worth Effect Pref Mod
Ladle Axe 1 1 100 0 20 1 - - -
Iron Axe Axe 1 8 75 0 22 270 - - -
Steel Axe Axe 1 11 65 0 15 360 - - -
Silver Axe Axe 1 15 70 0 10 1000 - - -
Hand Axe Axe 1-2 7 60 0 10 300 - - -
Tomahawk Axe 1-2 13 65 0 7 3000 - - -
Killer Axe Axe 1 11 65 30 10 1000 - - -
Hammer Axe 1 10 55 0 10 800 Armor - -
Halberd Axe 1 10 60 0 8 810 Mount - -
Swordreaver Axe 1 11 65 5 7 2100 - - -
Brave Axe Axe 1 10 65 0 15 7500 - - -
Garm Axe 1 20 75 0 15 10000 - - Spd 5
Armads Axe 1 18 85 0 12 - - Hector Def 5
Iron Bow Bow 2 6 85 0 22 540 Flier - -
Steel Bow Bow 2 9 70 0 15 720 Flier - -
Silver Bow Bow 2 13 75 0 10 1600 Flier - -
Killer Bow Bow 2 9 75 30 10 1400 Flier - -
Brave Bow Bow 2 10 70 0 15 7500 Flier - -
Debug Short Bow Bow 1-2 5 85 10 11 1760 Flier - -
Longbow Bow 2-3 5 65 0 10 2000 Flier - -
Double Bow Bow 2-3 18 85 5 12 10000 Flier - Str 5
Bowgun Crossbow 1-2 24 100 0 12 2000 Flier - -
Crossbow Crossbow 1-2 28 100 0 10 3000 Flier - -
Aqqar Crossbow 1-2 32 100 0 8 5000 Flier - -
Arbalest Crossbow 1-2 38 100 15 10 10000 Flier - -
Fire Anima 1-2 5 90 0 20 560 - - -
Elfire Anima 1-2 10 85 0 15 1200 - - -
Fimbulvetr Anima 1-2 13 80 0 10 6000 - - -
Excalibur Anima 1-2 18 90 10 15 15000 Flier - Spd 5
Lightning Light 1-2 4 95 5 17 630 - - -
Divine Light 1-2 8 85 10 12 2500 - - -
Debug Purge Light 3-10 10 70 5 2 3000 - - -
Aura Light 1-2 12 85 15 10 8000 - - -
Aureola Light 1-2 15 90 5 10 15000 - - Res 5
Flux Dark 1-2 7 80 0 22 900 - - -
Eclipse Dark 3-10 0 10 -900 2 4000 - - -
Lunase Dark 1-2 0 50 0 17 4200 - - -
Nosferatu Dark 1-2 10 70 0 10 3200 - - -
Debug Fenrir Dark 1-2 15 70 0 10 9000 - - -
Ereshkigal Dark 1-2 20 95 0 12 15000 - - Skl 5
Heal Staff 1 10 100 0 15 600 - - -
Mend Staff 1 20 100 0 10 1000 - - -
Recover Staff 1 99 100 0 7 2250 - - -
Physic Staff 1-Mag/2 10 100 0 4 7500 - - -
#Name Type Range Mt Hit Crit Uses Worth Effect Pref Mod Class
Ladle Axe 1 1 100 0 20 1 - - - -
Iron Axe Axe 1 8 75 0 22 270 - - - -
Steel Axe Axe 1 11 65 0 15 360 - - - -
Silver Axe Axe 1 15 70 0 10 1000 - - - -
Hand Axe Axe 1-2 7 60 0 10 300 - - - Throw
Tomahawk Axe 1-2 13 65 0 7 3000 - - - Throw
Killer Axe Axe 1 11 65 30 10 1000 - - - Killer
Hammer Axe 1 10 55 0 10 800 Armor - - Slayer
Halberd Axe 1 10 60 0 8 810 Mount - - Slayer
Swordreaver Axe 1 11 65 5 7 2100 - - - Reaver
Brave Axe Axe 1 10 65 0 15 7500 - - - Brave
Garm Axe 1 20 75 0 15 10000 - - Spd 5 Legend
Armads Axe 1 18 85 0 12 - - Hector Def 5 -
Iron Bow Bow 2 6 85 0 22 540 Flier - - -
Steel Bow Bow 2 9 70 0 15 720 Flier - - -
Silver Bow Bow 2 13 75 0 10 1600 Flier - - -
Killer Bow Bow 2 9 75 30 10 1400 Flier - - Killer
Brave Bow Bow 2 10 70 0 15 7500 Flier - - Brave
Debug Short Bow Bow 1-2 5 85 10 11 1760 Flier - - -
Longbow Bow 2-3 5 65 0 10 2000 Flier - - -
Double Bow Bow 2-3 18 85 5 12 10000 Flier - Str 5 Legend
Bowgun Crossbow 1-2 24 100 0 12 2000 Flier - - -
Crossbow Crossbow 1-2 28 100 0 10 3000 Flier - - -
Aqqar Crossbow 1-2 32 100 0 8 5000 Flier - - -
Arbalest Crossbow 1-2 38 100 15 10 10000 Flier - - Legend
Fire Anima 1-2 5 90 0 20 560 - - - -
Elfire Anima 1-2 10 85 0 15 1200 - - - -
Fimbulvetr Anima 1-2 13 80 0 10 6000 - - - -
Excalibur Anima 1-2 18 90 10 15 15000 Flier - Spd 5 Legend
Lightning Light 1-2 4 95 5 17 630 - - - -
Divine Light 1-2 8 85 10 12 2500 - - - 0
Debug Purge Light 3-10 10 70 5 2 3000 - - - Siege
Aura Light 1-2 12 85 15 10 8000 - - - -
Aureola Light 1-2 15 90 5 10 15000 - - Res 5 Legend
Flux Dark 1-2 7 80 0 22 900 - - - -
Eclipse Dark 3-10 0 10 -900 2 4000 - - - Siege
Lunase Dark 1-2 0 50 0 17 4200 - - - -
Nosferatu Dark 1-2 10 70 0 10 3200 - - - -
Debug Fenrir Dark 1-2 15 70 0 10 9000 - - - -
Ereshkigal Dark 1-2 20 95 0 12 15000 - - Skl 5 Legend
Heal Staff 1 10 100 0 15 600 - - - Healing
Mend Staff 1 20 100 0 10 1000 - - - Healing
Recover Staff 1 99 100 0 7 2250 - - - Healing
Physic Staff 1-Mag/2 10 100 0 4 7500 - - - Healing
# Debug items
Debug Sword Sword 1 10 100 200 20 1000 - - -
Debug Axe Axe 1 10 100 200 20 1000 - - -
Debug Bow Bow 1-3 10 100 0 1 1000 - - -
Debug Lance Lance 1 10 100 200 20 1000 - - -
Debug Javelin Lance 1-2 10 100 200 20 1000 - - -
Debug Noodle Axe 1 1 100 0 2 9999 - - -
Debug Aether Sword 1 1 100 -900 20 1000 - - Skl 999
Debug Sword Sword 1 10 100 200 20 1000 - - - -
Debug Axe Axe 1 10 100 200 20 1000 - - - -
Debug Bow Bow 1-3 10 100 0 1 1000 - - - -
Debug Lance Lance 1 10 100 200 20 1000 - - - -
Debug Javelin Lance 1-2 10 100 200 20 1000 - - - -
Debug Noodle Axe 1 1 100 0 2 9999 - - - -
Debug Aether Sword 1 1 100 -900 20 1000 - - Skl 999 -
1 change: 1 addition & 0 deletions src/net/fe/builderStage/ClientWaitStage.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public ClientWaitStage(Session s) {
super("preparations");
start = false;
session = s;

}

/* (non-Javadoc)
Expand Down
154 changes: 154 additions & 0 deletions src/net/fe/builderStage/ShopInventory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
package net.fe.builderStage;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Map;

import net.fe.builderStage.ShopInventory;
import net.fe.modifier.Modifier;
import net.fe.unit.Item;
import net.fe.unit.Unit;
import net.fe.unit.Weapon;

public class ShopInventory {
private static ShopInventory obj;

private Map<String, Integer> inventory;
private Map<String, Integer> classInventory;

public ShopInventory(Iterable<Modifier> mods){
inventory = new HashMap<String, Integer>();
classInventory = new HashMap<String, Integer>();

for(Item i : Item.getAllItems()){
inventory.put(i.name, -1);
if(i.getItemClass() != "" && !inventory.containsKey(i.getItemClass())){
classInventory.put(i.getItemClass(), -1);
}
}

if(mods != null){

for(Modifier m : mods){
m.setShopLimits(inventory, classInventory);
}
}
}


/**
* Takes the item name of the item the player is trying to buy. Returns true and decrements the remaining
* stock (both from class and item) if it succeeds, false if the weapon can't be bought.
*
* @param itemName - The name of the item to buy
* @return
*/
public boolean buyItem(Item item){
if(classInventory.get(item.getItemClass()) != null){

if(inventory.get(item.name) != 0 && classInventory.get(item.getItemClass()) != 0){
if(inventory.get(item.name) != -1){
inventory.put(item.name, inventory.get(item.name) - 1);
}

if(classInventory.get(item.getItemClass()) != -1){
classInventory.put(item.getItemClass(), classInventory.get(item.getItemClass())-1);
}

return true;
}
return false;
}
else{
if(inventory.get(item.name) != 0){
if(inventory.get(item.name) != -1){
inventory.put(item.name, inventory.get(item.name) - 1);
}

return true;
}
return false;
}
}

/**
* Returns true if the item is still in stock, false otherwise.
*
* @param itemName
* @return
*/
public boolean itemInStock(Item item){
if(classInventory.get(item.getItemClass()) != null){
return ((inventory.get(item.name) != 0) && (classInventory.get(item.getItemClass()) != 0));

}
else{
return inventory.get(item.name) != 0;
}

}

/**
* Returns the items that this unit has to the shop inventory. Does not remove the items from
* the unit!
*
* @param unit
*/
public void refundItems(Unit unit){
System.out.println("Refunding items on: " + unit.name);
for(Item i : unit.getInventory()){
System.out.println("Refunding: " + i.name);
if(!(i instanceof Weapon && ((Weapon) i).pref != null)){
if(inventory.get(i.name) != -1){
System.out.println("+1 : " + i.name + " available");
inventory.put(i.name, inventory.get(i.name) + 1);
}
if(classInventory.get(i.getItemClass()) != null && classInventory.get(i.getItemClass()) != -1){
System.out.println("+1 : " + i.getItemClass() + " available");
classInventory.put(i.getItemClass(), classInventory.get(i.getItemClass()) + 1);
}
}

}
}

/**
* Increases the stock of a single item by 1.
*
* @param item
*/
public void returnItem(Item item){
if(inventory.get(item.name) != -1){
inventory.put(item.name, inventory.get(item.name) + 1);
}
if(classInventory.get(item.getItemClass()) != null && classInventory.get(item.getItemClass()) != -1){
classInventory.put(item.getItemClass(), classInventory.get(item.getItemClass()) + 1);
}
}

/**
* Takes in an item and returns the number currently available. Returns -1 if there are infinitely many left.
*
* @param itemName
* @return
*/
public int countOf(Item item){
//If it has a class, check it. Otherwise, return the individual value.
if(classInventory.get(item.getItemClass()) != null){

//If both are infinite, it's infinite
if(inventory.get(item.name) <= -1 && classInventory.get(item.getItemClass()) <= -1){
return -1;
}
//If one is -1, the other (higher) value should be returned.
if(inventory.get(item.name) <= -1 || classInventory.get(item.getItemClass()) <= -1){
return Math.max(inventory.get(item.name), classInventory.get(item.getItemClass()));
}
else{
return Math.min(inventory.get(item.name), classInventory.get(item.getItemClass()));
}
}
else{
return inventory.get(item.name);
}
}
}
Loading