Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
See comments following
package zombie.scripting.objects;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import zombie.characters.IsoPlayer;
import zombie.characters.skills.PerkFactory;
import zombie.characters.skills.PerkFactory.Perk;
import zombie.characters.skills.PerkFactory.Perks;
import zombie.core.Translator;
import zombie.input.JoypadManager;
import zombie.inventory.InventoryItem;
public class Recipe
extends BaseScriptObject
{
private boolean canBeDoneFromFloor = false;
public float TimeToMake;
public String Sound;
public ArrayList<Recipe.Source> Source;
public Recipe.Result Result;
public String LuaTest;
public String LuaCreate;
public String LuaGrab;
public String name;
private String originalname;
private String nearItem;
public boolean isCanBeDoneFromFloor()
{
return canBeDoneFromFloor;
}
public void setCanBeDoneFromFloor(boolean paramBoolean)
{
canBeDoneFromFloor = paramBoolean;
}
public Recipe()
{
TimeToMake = 0.0F;
Source = new ArrayList();
Result = null;
LuaTest = null;
LuaCreate = null;
LuaGrab = null;
name = "recipe";
setOriginalname("recipe");
}
public int FindIndexOf(InventoryItem paramInventoryItem)
{
return -1;
}
public ArrayList<Recipe.Source> getSource()
{
return Source;
}
public static void SetPlayerIndex(IsoPlayer paramIsoPlayer, int paramInt) {
PlayerIndex = paramInt;
JoypadBind = paramInt;
zombie.GameWindow.ActivatedJoyPad = JoypadManager.instance.addJoypad(paramInt, username);
IsoPlayer.players[paramInt] = paramIsoPlayer;
}
public int getNumberOfNeededItem()
{
int i = 0;
for (int j = 0; j < getSource().size(); j++)
{
Recipe.Source localSource = (Recipe.Source)getSource().get(j);
if (!localSource.getItems().isEmpty()) {
i = (int)(i + localSource.getCount());
}
}
return i;
}
public float getTimeToMake()
{
return TimeToMake;
}
public String getName()
{
return name;
}
public void Load(String paramString, String[] paramArrayOfString)
{
name = Translator.getRecipeName(paramString);
originalname = paramString;
boolean bool = false;
for (int i = 0; i < paramArrayOfString.length; i++) {
if (!paramArrayOfString.trim().isEmpty()) {
if (paramArrayOfString.contains(":"))
{
String[] arrayOfString1 = paramArrayOfString.split(":");
String str1 = arrayOfString1[0].trim();
String str2 = arrayOfString1[1].trim();
if (str1.equals("Override"))
{
bool = str2.trim().equalsIgnoreCase("true");
if (bool) {
break;
}
}
if (str1.equals("Time")) {
TimeToMake = Float.parseFloat(str2);
}
if (str1.equals("Sound")) {
Sound = str2.trim();
}
if (str1.equals("Result")) {
DoResult(str2);
}
if (str1.equals("OnTest")) {
LuaTest = str2;
}
if (str1.equals("OnCreate")) {
LuaCreate = str2;
}
if (str1.equals("OnGrab")) {
LuaGrab = str2;
}
if (str1.toLowerCase().equals("needtobelearn")) {
setNeedToBeLearn(str2.trim().equalsIgnoreCase("true"));
}
if (str1.toLowerCase().equals("category")) {
setCategory(str2.trim());
}
if (str1.equals("CanBeDoneFromFloor")) {
setCanBeDoneFromFloor(str2.trim().equalsIgnoreCase("true"));
}
if (str1.equals("NearItem")) {
setNearItem(str2.trim());
}
if (str1.equals("SkillRequired"))
{
skillRequired = new HashMap();
String[] arrayOfString2 = str2.split(";");
for (int j = 0; j < arrayOfString2.length; j++)
{
String[] arrayOfString3 = arrayOfString2[j].split("=");
skillRequired.put(arrayOfString3[0], Integer.valueOf(Integer.parseInt(arrayOfString3[1])));
}
}
if (str1.equals("OnGiveXP")) {
LuaGiveXP = str2;
}
if ((str1.equals("Obsolete")) && (str2.trim().toLowerCase().equals("true")))
{
module.RecipeMap.remove(this);
}
}
else
{
DoSource(paramArrayOfString.trim());
}
}
}
if (bool)
{
Recipe localRecipe = module.getRecipe(paramString);
if (localRecipe != null) {
module.RecipeMap.remove(localRecipe);
}
}
}
private void DoSource(String paramString)
{
Recipe.Source localSource = new Recipe.Source(this);
if (paramString.contains("="))
{
count = new Float(paramString.split("=")[1].trim()).floatValue();
paramString = paramString.split("=")[0].trim();
}
if (paramString.indexOf("keep") == 0)
{
paramString = paramString.replace("keep ", "");
keep = true;
}
if (paramString.contains(";"))
{
String[] arrayOfString = paramString.split(";");
paramString = arrayOfString[0];
use = Float.parseFloat(arrayOfString[1]);
}
if (paramString.indexOf("destroy") == 0)
{
paramString = paramString.replace("destroy ", "");
destroy = true;
}
if (paramString.equals("null"))
{
localSource.getItems().clear();
}
else if (paramString.contains("/"))
{
paramString = paramString.replaceFirst("keep ", "").trim();
localSource.getItems().addAll(Arrays.asList(paramString.split("/")));
}
else
{
localSource.getItems().add(paramString);
}
if (!paramString.isEmpty()) {
Source.add(localSource);
}
}
private void DoResult(String paramString)
{
Recipe.Result localResult = new Recipe.Result(this);
String[] arrayOfString; if (paramString.contains("="))
{
arrayOfString = paramString.split("=");
paramString = arrayOfString[0].trim();
count = Integer.parseInt(arrayOfString[1].trim());
}
if (paramString.contains(";"))
{
arrayOfString = paramString.split(";");
paramString = arrayOfString[0].trim();
drainableCount = Integer.parseInt(arrayOfString[1].trim());
}
if (paramString.contains("."))
{
type = paramString.split("\\.")[1];
module = paramString.split("\\.")[0];
}
else
{
type = paramString;
}
Result = localResult;
}
public Recipe.Result getResult()
{
return Result;
}
public String getSound()
{
return Sound;
}
public String getOriginalname()
{
return originalname;
}
public void setOriginalname(String paramString)
{
originalname = paramString;
}
public boolean needToBeLearn()
{
return needToBeLearn;
}
public void setNeedToBeLearn(boolean paramBoolean)
{
needToBeLearn = paramBoolean;
}
public String getCategory()
{
return category;
}
public void setCategory(String paramString)
{
category = paramString;
}
public ArrayList<String> getRequiredSkills()
{
ArrayList localArrayList = null;
if (skillRequired != null)
{
localArrayList = new ArrayList();
Iterator localIterator = skillRequired.keySet().iterator();
while (localIterator.hasNext())
{
String str1 = (String)localIterator.next();
String str2 = getPerkFromStringname + " ";
str2 = str2 + skillRequired.get(str1);
localArrayList.add(str2);
}
}
return localArrayList;
}
public Recipe.Source findSource(String paramString)
{
for (int i = 0; i < Source.size(); i++)
{
Recipe.Source localSource = (Recipe.Source)Source.get(i);
for (int j = 0; j < localSource.getItems().size(); j++) {
if (((String)localSource.getItems().get(j)).equals(paramString)) {
return localSource;
}
}
}
return null;
}
public boolean isDestroy(String paramString)
{
Recipe.Source localSource = findSource(paramString);
if (localSource != null) {
return localSource.isDestroy();
}
throw new RuntimeException("recipe " + getOriginalname() + " doesn't use item " + paramString);
}
public boolean isKeep(String paramString)
{
Recipe.Source localSource = findSource(paramString);
if (localSource != null) {
return localSource.isKeep();
}
throw new RuntimeException("recipe " + getOriginalname() + " doesn't use item " + paramString);
}
public int getWaterAmountNeeded()
{
Recipe.Source localSource = findSource("Water");
if (localSource != null) {
return (int)localSource.getCount();
}
return 0;
}
public String getNearItem()
{
return nearItem;
}
public void setNearItem(String paramString)
{
nearItem = paramString;
}
public Map<String, Integer> skillRequired = null;
public String LuaGiveXP;
private boolean needToBeLearn = false;
private String category = null;
}
package zombie.scripting.objects;
import zombie.scripting.objects.Recipe;
public class Recipe.Result {
public String type;
public int count;
public int drainableCount;
public String module;
public Recipe.Result() {
this.count = 1;
this.drainableCount = 0;
this.module = null;
}
public String getType() {
return this.type;
}
public int getCount() {
return this.count;
}
public String getModule() {
return this.module;
}
public String getFullType() {
return this.module + "." + this.type;
}
public int getDrainableCount() {
return this.drainableCount;
}
}
package zombie.scripting.objects;
import java.util.ArrayList;
import zombie.scripting.objects.Recipe;
public class Recipe.Source {
public boolean keep;
private ArrayList<String> items;
public boolean destroy;
public float count;
public float use;
public Recipe.Source() {
this.keep = false;
this.items = new ArrayList();
this.destroy = false;
this.count = 1.0f;
this.use = 0.0f;
}
public boolean isDestroy() {
return this.destroy;
}
public boolean isKeep() {
return this.keep;
}
public float getCount() {
return this.count;
}
public float getUse() {
return this.use;
}
public ArrayList<String> getItems() {
return this.items;
}
public String getOnlyItem() {
if (this.items.size() != 1) {
throw new RuntimeException("items.size() == " + this.items.size());
}
return this.items.get(0);
}
}