Skip to content
Merged
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
Binary file modified Assets/CWAssets/CWGame.unity
Binary file not shown.
Binary file modified Assets/CWAssets/Images/Materials/attacker_overlay.mat
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions Assets/CWAssets/Resources/Prefabs/Battle/Card n.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Assets/CWAssets/Resources/Prefabs/Battle/Card.prefab
Binary file not shown.
8 changes: 7 additions & 1 deletion Assets/CWAssets/Resources/Prefabs/Battle/Card.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
10 changes: 10 additions & 0 deletions Assets/CWAssets/Resources/Prefabs/Battle/CardBack 1.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Assets/CWAssets/Resources/Prefabs/Battle/GameOver.prefab
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file modified Assets/CWAssets/Resources/Prefabs/Battle/Materials/card_art.mat
Binary file not shown.
Binary file modified Assets/CWAssets/Resources/Prefabs/Battle/Materials/card_front.mat
Binary file not shown.
Binary file not shown.
47 changes: 0 additions & 47 deletions Assets/CWAssets/Resources/Prefabs/Battle/cardfront0.png.meta

This file was deleted.

94 changes: 78 additions & 16 deletions Assets/CWAssets/Scripts/Battle/Cards/AbstractCard.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using UnityEngine.UI;

namespace CW
{
public class AbstractCard : MonoBehaviour
Expand All @@ -11,7 +13,7 @@ public class AbstractCard : MonoBehaviour
private BattlePlayer player;
public string name, type = " ", description = " ", dietChar= " ";
public DIET diet;
private bool canAttackNow, inMotion, moveBack;
private bool canAttackNow, inMotion, moveBack;
private Vector3 oriPosition;
private Vector3 newPosition;
private bool zoomed = false;
Expand All @@ -36,6 +38,10 @@ public enum DIET
private float raised = 50f;
public bool isInHand = true;
public bool isInPlay = false;

//2018/03/21 Added mouse hover
private bool _mouseOver = false;

//Initialization for a card and sets it's position to (1000, 1000, 1000)
public void init(BattlePlayer player, int cardID, string diet, int level, int attack, int health, string species_name, string type, string description)
{
Expand All @@ -53,9 +59,10 @@ public void init(BattlePlayer player, int cardID, string diet, int level, int at
this.dietChar = diet;
this.level = level;
maxHP = hp = health;
type = this.type;
naturalDmg = dmg = attack;
//this.type = type; //hide temporarily
//this.description = description; //hide temporarily
this.description = description; //hide temporarily


Texture2D cardTexture;
Expand Down Expand Up @@ -86,18 +93,22 @@ public void init(BattlePlayer player, int cardID, string diet, int level, int at
}

}

//Changing cardfront texture
GetComponent<Renderer>().material.mainTexture = cardTexture;
//Changing cardfront texture
GetComponent<Renderer>().material.mainTexture = cardTexture;
transform.Find ("CardArt").GetComponent<MeshRenderer> ().material.mainTexture = speciesTexture;

//Changing card text
// Color gold = new Color (209f, 234f, 50f, 255f);
transform.Find ("NameText").GetComponent<TextMesh> ().text = TextWrap (this.name, 16);
transform.Find ("TypeText").GetComponent<TextMesh> ().text = this.type;
transform.Find ("TypeText").GetComponent<MeshRenderer> ().material.color = Color.white;
transform.Find ("DescriptionText").GetComponent<TextMesh> ().text = TextWrap (this.description, 26);
transform.Find ("DescriptionText").GetComponent<MeshRenderer> ().material.color = Color.white;
Transform child = transform.Find("Canvas/Pop/Image");
Image i = child.GetComponent<Image>();
Sprite s = Sprite.Create(speciesTexture, new Rect(0, 0, speciesTexture.width, speciesTexture.height), Vector2.zero);
i.sprite = s;

//Changing card text
// Color gold = new Color (209f, 234f, 50f, 255f);
transform.Find ("NameText").GetComponent<TextMesh> ().text = TextWrap (this.name, 16);
//transform.Find ("TypeText").GetComponent<TextMesh> ().text = this.type;
//transform.Find ("TypeText").GetComponent<MeshRenderer> ().material.color = Color.white;
//transform.Find ("DescriptionText").GetComponent<TextMesh> ().text = TextWrap (this.description, 26);
//transform.Find ("DescriptionText").GetComponent<MeshRenderer> ().material.color = Color.white;
transform.Find ("LevelText").GetComponent<TextMesh> ().text = "" + this.level;
transform.Find ("LevelText").GetComponent<MeshRenderer> ().material.color = Color.white;
transform.Find ("DoneText").GetComponent<MeshRenderer> ().material.color = Color.red;
Expand All @@ -120,14 +131,20 @@ public void init(BattlePlayer player, int cardID, string diet, int level, int at
DIET getDietType (string diet)
{
if (diet == "o") {
//added
type = "Omnivore";
return DIET.OMNIVORE;
} else if (diet == "c") {
return DIET.CARNIVORE;
type = "Carnivore";
return DIET.CARNIVORE;
} else if (diet == "h") {
return DIET.HERBIVORE;
type = "Herbivore";
return DIET.HERBIVORE;
} else if (diet == "f") {
return DIET.FOOD;
type = "food";
return DIET.FOOD;
} else
type = "weather";
return DIET.WEATHER;
//else diet == 2
}
Expand Down Expand Up @@ -237,9 +254,54 @@ void OnMouseExit ()
}*/
zoomed = false;
clicked = false;
//2018/03/22
_mouseOver = false;
}

public int getDamage ()
//2018/03/22
/*How to do? 1) put card prefab to hierarchy
* 2) under card create empty
* 3) for plane: add mesh filter and plane and add mesh renderer
* 4) for text: add mesh renderer and text
* Caution: adjust camera carefully */
void OnMouseOver()
{
_mouseOver = true;
}

//2018/03/22
void OnGUI()
{
//if mouse not hover
if (!_mouseOver)
{
transform.Find("Hello").GetComponent<TextMesh>().text = "---";
transform.Find("Canvas/Pop").gameObject.SetActive(false);
}
//if mouse hover
else
{
transform.Find("Hello").GetComponent<TextMesh>().text = "-^-";
transform.Find("Canvas/Pop").gameObject.SetActive(true);
//transform.Find("Pop/Image").GetComponent<Image>().sprite = sImage;
//transform.Find("Canvas/Pop/Sname").GetComponent<TextMesh>().text = TextWrap(this.name, 16);
//transform.Find("Canvas/Pop/Stype").GetComponent<TextMesh>().text = this.type;
//transform.Find("Canvas/Pop/Sdescription").GetComponent<TextMesh>().text = TextWrap(this.description, 16);
Transform child = transform.Find("Canvas/Pop/Sname");
Text t = child.GetComponent<Text>();
t.text = TextWrap(this.name, 70);

child = transform.Find("Canvas/Pop/Sdescription");
t = child.GetComponent<Text>();
t.text = this.description;

child = transform.Find("Canvas/Pop/Stype");
t = child.GetComponent<Text>();
t.text = TextWrap(this.type, 70);
}
}

public int getDamage ()
{
return this.dmg;
}
Expand Down
4 changes: 2 additions & 2 deletions Assets/CWAssets/Scripts/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class Constants {
public static readonly string CLIENT_VERSION = "1.00";
//public static readonly string REMOTE_HOST = "localhost";//"thecity.sfsu.edu"; // "localhost"; //"localhost"; "smurf.sfsu.edu";
// public static readonly string REMOTE_HOST = "thecity.sfsu.edu";
// public static readonly string REMOTE_HOST = "smurf.sfsu.edu";
public static readonly string REMOTE_HOST = "54.153.66.118"; // AWS from Ben, 2-2017
public static readonly string REMOTE_HOST = "smurf.sfsu.edu";
//public static readonly string REMOTE_HOST = "54.153.66.118"; // AWS from Ben, 2-2017
public static readonly int REMOTE_PORT = 9260; // for thecity
//public static readonly int REMOTE_PORT = 20038; // for localhost
public static readonly float HEARTBEAT_RATE = 1f;
Expand Down
Binary file modified Assets/Game.unity
Binary file not shown.
Binary file modified Assets/Resources/Images/Materials/Acacia.mat
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Assets/Resources/Models/ClashOfSpecies/Bat-Eared Fox.fbm.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Assets/Resources/Models/ClashOfSpecies/Buffalo.fbm.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Assets/Resources/Models/ClashOfSpecies/Lion.fbm.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Assets/Resources/Models/ClashOfSpecies/Serval Cat.fbm.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Assets/SDAssets/Materials/SDGameMain/White.mat
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/Scripts/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using UnityEngine;

public class Config {
// public static readonly string REMOTE_HOST = "localhost";
//public static readonly string REMOTE_HOST = "localhost";
//public static readonly string REMOTE_HOST = "52.25.138.18";
// public static readonly string REMOTE_HOST = "thecity.sfsu.edu";
public static readonly string REMOTE_HOST = "smurf.sfsu.edu";
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Constants
// Constants
public static readonly string CLIENT_VERSION = "1.00";

// public static readonly string REMOTE_HOST = "localhost";
//public static readonly string REMOTE_HOST = "localhost";
// public static readonly string REMOTE_HOST = "thecity.sfsu.edu";
public static readonly string REMOTE_HOST = "smurf.sfsu.edu";
// public static readonly string REMOTE_HOST = "54.153.66.118"; // AWS from Ben, 2-2017
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/Login.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class Login : MonoBehaviour
public Texture background;
private Texture2D bgTexture;
private Font font;
private string user_id = "";
private string password = "";
private string user_id = "rrex";
private string password = "1234";
private Rect windowRect;
private bool isActive = true;
private bool isInitial = true;
Expand Down