Skip to content

Commit

Permalink
Half Done Hero UI hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
TuckerBMorgan committed May 28, 2016
1 parent c997e07 commit 3c3c424
Show file tree
Hide file tree
Showing 20 changed files with 1,267 additions and 45 deletions.
1,030 changes: 1,030 additions & 0 deletions .vs/config/applicationhost.config

Large diffs are not rendered by default.

Binary file modified Assets/Main.unity
Binary file not shown.
Binary file modified Assets/Resources/HeroAvatar.prefab
Binary file not shown.
9 changes: 9 additions & 0 deletions Assets/Resources/HeroPortraits.meta

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

Binary file added Assets/Resources/HeroPortraits/hunterPort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions Assets/Resources/HeroPortraits/hunterPort.png.meta

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

9 changes: 9 additions & 0 deletions Assets/Resources/HeroPowers.meta

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

Binary file added Assets/Resources/HeroPowers/hunterPower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions Assets/Resources/HeroPowers/hunterPower.png.meta

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

22 changes: 0 additions & 22 deletions Assets/Scripts/HeroAvatar.cs

This file was deleted.

12 changes: 0 additions & 12 deletions Assets/Scripts/HeroAvatar.cs.meta

This file was deleted.

83 changes: 80 additions & 3 deletions Assets/Scripts/UI/HeroAvatar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,98 @@

public class HeroAvatar : MonoBehaviour {

public const string HERO_PORTRAIT_PATH = "HeroPortaits/";
public const string HERO_POWER_PATH = "HeroPowers/";

public Text mana;
public Image portrait;
public Image heroPower;

public int currentMana;
public int currentTopMana;

public bool HomeAvatar;

public string careAboutGuid;

// Use this for initialization
void Start () {

}

RuneManager.Singelton.AddListener(typeof(NewController), SetHero);
RuneManager.Singelton.AddListener(typeof(SetBaseMana), OnSetBaseMana);
RuneManager.Singelton.AddListener(typeof(SetMana), OnSetMana);
RuneManager.Singelton.AddListener(typeof(ModifyHealth), OnModifyHealth);
}

// Update is called once per frame
void Update () {

}

public void OnModifyHealth(Rune rune, System.Action action)
{


action();
}


public void SetHero(Rune rune, System.Action action)
{
NewController nc = rune as NewController;
string str = HERO_PORTRAIT_PATH + nc.hero + "Port";

Sprite heroPort = Resources.Load<Sprite>("HeroPortraits/hunterPort");
Sprite heroPower = Resources.Load<Sprite>(HERO_POWER_PATH + nc.hero + "Power");

if (nc.isMe == HomeAvatar)
{
careAboutGuid = nc.controllerGuid;
}
portrait.overrideSprite = heroPort;
this.heroPower.overrideSprite = heroPower;
action();
}

public void OnSetBaseMana(Rune rune, System.Action action)
{
SetBaseMana sbm = rune as SetBaseMana;
if (sbm.controllerGuid != careAboutGuid)
{
action();
return;
}
currentTopMana = sbm.baseMana;
mana.text = currentMana + " : " + currentTopMana;

action();
}

public void OnSetMana(Rune rune, System.Action action)
{

SetMana sm = rune as SetMana;
if(sm.controllerGuid != careAboutGuid)
{
action();
return;
}
currentMana = sm.mana;
mana.text = currentMana + " : " + currentTopMana;
action();
}

public void OnPortaitClicked()
{

}

public void OnHeroPowerClicked()
{

}




}

2 changes: 1 addition & 1 deletion Assets/Scripts/UI/HeroAvatar.cs.meta

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

Binary file modified ProjectSettings/GraphicsSettings.asset
Binary file not shown.
Binary file modified ProjectSettings/ProjectSettings.asset
Binary file not shown.
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 5.3.3f1
m_EditorVersion: 5.3.4f1
m_StandardAssetsVersion: 0
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
Fireplacerock is a remake of the Blizzard Digtal card game Hearthstone. It is fullly a fan project, just doing it to have some fun, and learn what I can.
Fireplacerock is a remake of the Blizzard Digtal card game Hearthstone. It is fullly a fan project, just doing it to have some fun, and learn what I can.

Setup:
requires: Node 4.4.0
launch with command node ./server in Server folder
Then just launch and play the Unity Main Scene File

To change what cards are in the deck Edit the testdeck.js file
3 changes: 2 additions & 1 deletion Server/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ function bootstrap(state) {
"guid":guid,
"name":name,
"controllerType":type,
"hero":"testhero"
"hero":"hunter"
}
newController.execute(obj, state)
state.controllersByIP[element] = state.controllers[guid];
Expand Down Expand Up @@ -435,6 +435,7 @@ function bootstrap(state) {
}
if(state.controllers[element].type == newController.PLAYER_CONTROLLER)
{
console.log(JSON.stringify(sec));
//and send it
server.sendMessage(JSON.stringify(sec), state.controllers[element].socket);
}
Expand Down
8 changes: 4 additions & 4 deletions Server/heros/hunter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports.hero = {
"cost":2
},
//A short note about IDS, THEY CANNOT CHANGE unless all files that use it change as a well, they are the only way to go from an instance of a entity to the file that they use
"id":"testhero"
"id":"hunter"
}

exports.attackPower = 2;
Expand All @@ -30,13 +30,13 @@ exports.canUse = function (heroController, targetController, state) {
exports.validatePowerTarget = function (hero, target, state) {
if(target.type == entity.HERO)
{

return true;
}
return false;
}

exports.usePower = function (hero, target, state) {
//This needs to be a rune
// target.health -= exports.attackPower;

}

exports.needMoreTargetInfo = function () {
Expand Down
9 changes: 9 additions & 0 deletions Server/runes/SetHealth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


exports.executeRune = function(rune, state) {

}

exports.canSee = function (params) {
return true;
}

0 comments on commit 3c3c424

Please sign in to comment.