Merge branch 'master' of https://github.com/ConjureETS/Human-Farm-Tycoon
6443
Assets/Scene/MAScene.unity
Normal file
8
Assets/Scene/MAScene.unity.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 02e761a4726444e49b32cb4436b8e06b
|
||||||
|
timeCreated: 1439488977
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
6443
Assets/Scene/MikeScene.unity
Normal file
8
Assets/Scene/MikeScene.unity.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3bacd42736b9b75418b7fd12379e8064
|
||||||
|
timeCreated: 1439492684
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
23
Assets/Script/ConfirmStatsScript.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class ConfirmStatsScript : MonoBehaviour {
|
||||||
|
|
||||||
|
public Text currentValues;
|
||||||
|
public Text addedValues;
|
||||||
|
public Text alertTitle;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
Stats stats = GameObject.Find("Stats").gameObject.GetComponent<Stats>();
|
||||||
|
currentValues.text = stats.displayCurrentStats();
|
||||||
|
addedValues.text = stats.displayAddingStats();
|
||||||
|
alertTitle.text = "DAY " + stats.NbTurns;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Assets/Script/ConfirmStatsScript.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c11185c2efdb07f4ea21f9c01b32dedb
|
||||||
|
timeCreated: 1439482178
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -1,9 +1,13 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using System;
|
||||||
|
|
||||||
public class Stats : MonoBehaviour
|
public class Stats : MonoBehaviour
|
||||||
{
|
{
|
||||||
#region attributes
|
#region attributes
|
||||||
|
|
||||||
|
private int nbTurns;
|
||||||
|
|
||||||
private int amountOfRock;
|
private int amountOfRock;
|
||||||
private int amountOfWood;
|
private int amountOfWood;
|
||||||
private int amountOfCorpse;
|
private int amountOfCorpse;
|
||||||
@ -22,8 +26,38 @@ public class Stats : MonoBehaviour
|
|||||||
private int nbZombieAssigneRock;
|
private int nbZombieAssigneRock;
|
||||||
private int nbZombieAssigneCorpse;
|
private int nbZombieAssigneCorpse;
|
||||||
private int nbZombieAssigneMeat;
|
private int nbZombieAssigneMeat;
|
||||||
|
|
||||||
public int NbZombieAssigneMeat
|
private int nbHumanHouses;
|
||||||
|
private int nbZombieHouses;
|
||||||
|
|
||||||
|
private int humanHunger;
|
||||||
|
private int zombieHunger;
|
||||||
|
|
||||||
|
public int AmountOfZHunger
|
||||||
|
{
|
||||||
|
get { return zombieHunger; }
|
||||||
|
set { zombieHunger = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public int AmountOfHHunger
|
||||||
|
{
|
||||||
|
get { return humanHunger; }
|
||||||
|
set { humanHunger = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public int AmountHumanHouse
|
||||||
|
{
|
||||||
|
get { return nbHumanHouses; }
|
||||||
|
set { nbHumanHouses = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public int AmountZombieHouse
|
||||||
|
{
|
||||||
|
get { return nbZombieHouses; }
|
||||||
|
set { nbZombieHouses = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public int NbZombieAssigneMeat
|
||||||
{
|
{
|
||||||
get { return nbZombieAssigneMeat;}
|
get { return nbZombieAssigneMeat;}
|
||||||
set { nbZombieAssigneMeat = value;}
|
set { nbZombieAssigneMeat = value;}
|
||||||
@ -112,6 +146,11 @@ public class Stats : MonoBehaviour
|
|||||||
set { amountOfZombiesAvail = value; }
|
set { amountOfZombiesAvail = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int NbTurns
|
||||||
|
{
|
||||||
|
get { return nbTurns; }
|
||||||
|
set { nbTurns = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public void addCorpse()
|
public void addCorpse()
|
||||||
{
|
{
|
||||||
@ -184,7 +223,6 @@ public class Stats : MonoBehaviour
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
public Stats(int nbRock, int nbWood, int nbCorpse, int nbMeat, int nbHumans, int nbZombies)
|
public Stats(int nbRock, int nbWood, int nbCorpse, int nbMeat, int nbHumans, int nbZombies)
|
||||||
{
|
{
|
||||||
resetStats(nbRock, nbWood, nbCorpse, nbMeat, nbHumans, nbZombies, 5, 5, 5, 5);
|
resetStats(nbRock, nbWood, nbCorpse, nbMeat, nbHumans, nbZombies, 5, 5, 5, 5);
|
||||||
@ -208,15 +246,101 @@ public class Stats : MonoBehaviour
|
|||||||
NbZombieAssigneCorpse = 0;
|
NbZombieAssigneCorpse = 0;
|
||||||
NbZombieAssigneMeat = 0;
|
NbZombieAssigneMeat = 0;
|
||||||
AmountOfZombiesAvail = AmountOfZombies;
|
AmountOfZombiesAvail = AmountOfZombies;
|
||||||
|
AmountOfHHunger = 250 * AmountOfHumans;
|
||||||
|
AmountOfZHunger = 500 * AmountOfZombies;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use this for initialization
|
private void applyStatModifications()
|
||||||
void Start () {
|
{
|
||||||
resetStats(7, 6, 5, 4, 4, 10, 5, 2, 3, 1);
|
AmountOfCorpse += (NbZombieAssigneCorpse * NbOfCorpseByZombie);
|
||||||
|
AmountOfMeat += (NbZombieAssigneMeat * NbOfMeatByZombie);
|
||||||
|
AmountOfRock += (NbZombieAssigneRock * NbOfRockByZombie);
|
||||||
|
AmountOfWood += (NbZombieAssigneWood * NbOfWoodByZombie);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void advanceTurn()
|
||||||
|
{
|
||||||
|
nbTurns++;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool isHumanMaxCapacity()
|
||||||
|
{
|
||||||
|
int cap = nbHumanHouses * 10;
|
||||||
|
if (AmountOfHumans > cap)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool isZombieMaxCapacity()
|
||||||
|
{
|
||||||
|
int cap = nbZombieHouses * 10;
|
||||||
|
if (AmountOfZombies > cap)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void endTurn()
|
||||||
|
{
|
||||||
|
if (!isHumanMaxCapacity())
|
||||||
|
AmountOfHumans += (2 * AmountHumanHouse);
|
||||||
|
if (isZombieMaxCapacity())
|
||||||
|
AmountOfZombies -= AmountOfZombies % (AmountZombieHouse * 10);
|
||||||
|
applyStatModifications();
|
||||||
|
calculateHunger();
|
||||||
|
advanceTurn();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void calculateHunger()
|
||||||
|
{
|
||||||
|
AmountOfHHunger -= 10 * AmountOfHumans;
|
||||||
|
AmountOfZHunger -= 50 * AmountOfZombies;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String displayStats()
|
||||||
|
{
|
||||||
|
//TODO: Needs completion and formatting
|
||||||
|
String body = "";
|
||||||
|
body += "Wood: " + AmountOfWood + "\n";
|
||||||
|
body += "Meat: " + AmountOfMeat + "\n";
|
||||||
|
body += "Corpses: " + AmountOfCorpse + "\n";
|
||||||
|
body += "Rock: " + AmountOfRock + "\n";
|
||||||
|
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String displayAddingStats()
|
||||||
|
{
|
||||||
|
//TODO: Needs completion and formatting
|
||||||
|
String body = "";
|
||||||
|
body += "+" + NbZombieAssigneWood * NbOfWoodByZombie + "\n" + "\n";
|
||||||
|
body += "+" + NbZombieAssigneRock * NbOfRockByZombie + "\n" + "\n";
|
||||||
|
body += "+" + NbZombieAssigneMeat * NbOfMeatByZombie + "\n" + "\n";
|
||||||
|
body += "+" + NbZombieAssigneCorpse * NbOfCorpseByZombie + "\n" + "\n";
|
||||||
|
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String displayCurrentStats()
|
||||||
|
{
|
||||||
|
String body = "";
|
||||||
|
body += AmountOfWood + "\n" + "\n";
|
||||||
|
body += AmountOfRock + "\n" + "\n";
|
||||||
|
body += AmountOfMeat + "\n" + "\n";
|
||||||
|
body += AmountOfCorpse + "\n" + "\n";
|
||||||
|
|
||||||
|
return body;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
resetStats(3, 6, 7, 8, 4, 1, 5, 5, 5, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update () {
|
void Update () {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 2.8 KiB |
BIN
Assets/Sprite/Meat.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 967804323e6c1ee48adac38aa69c71c2
|
guid: 73aa87cf69a8e0e4ebeb3a297f854304
|
||||||
timeCreated: 1439408872
|
timeCreated: 1439492217
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
fileIDToRecycleName: {}
|
fileIDToRecycleName: {}
|
||||||
BIN
Assets/Sprite/WoodFrame.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 7c4cb422c3b74134ebe4065b3f730558
|
guid: ce975a919c84b9b45ac7ea2f3cca8419
|
||||||
timeCreated: 1439409065
|
timeCreated: 1439492252
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
fileIDToRecycleName: {}
|
fileIDToRecycleName: {}
|
||||||
|
Before Width: | Height: | Size: 9.1 KiB |
BIN
Assets/Sprite/lumberLog.png
Normal file
|
After Width: | Height: | Size: 79 KiB |
55
Assets/Sprite/lumberLog.png.meta
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d3f87475ef824414d9da6675bb8dde47
|
||||||
|
timeCreated: 1439492116
|
||||||
|
licenseType: Free
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: .25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 8
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: .5, y: .5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
textureType: 8
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 44 KiB |
@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e105c9c716b637945b393dd706a12c51
|
guid: aa9977d756cc31f4f99882795938d5ab
|
||||||
timeCreated: 1439408366
|
timeCreated: 1439492200
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
fileIDToRecycleName: {}
|
fileIDToRecycleName: {}
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
m_EditorVersion: 5.1.1f1
|
m_EditorVersion: 5.1.2f1
|
||||||
m_StandardAssetsVersion: 0
|
m_StandardAssetsVersion: 0
|
||||||
|
|||||||