Skip to content

Commit

Permalink
Hero small work
Browse files Browse the repository at this point in the history
  • Loading branch information
TuckerBMorgan committed May 21, 2016
1 parent 998aa54 commit c997e07
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 3 deletions.
Binary file modified Assets/Main.unity
Binary file not shown.
52 changes: 52 additions & 0 deletions Assets/Resources/Cards/Cards.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,56 @@
{
"heros":{
"test":{
"displayName":"Test",
"portaitImage":"testPort",
"heroPowerImage":"testHeroPower"
},
"hunter":{
"displayName":"Hunter",
"portaitImage":"hunterPort",
"heroPowerImage":"hunterHeroPower"
},
"priest":{
"displayName":"Priest",
"portaitImage":"priestPort",
"heroPowerImage":"priestHeroPower"
},
"shamen":{
"displayName":"shamen",
"portaitImage":"shamenPort",
"heroPowerImage":"shamenHeroPower"
},
"paladin":{
"displayName":"Paladin",
"portaitImage":"warlockPort",
"heroPowerImage":"paladinHeroPower"
},
"rogue":{
"displayName":"Rogue",
"portaitImage":"rougePort",
"heroPowerImage":"paladinHeroPower"
},
"warrior":{
"displayName":"Warrior",
"portaitImage":"warriorPort",
"heroPowerImage":"warriorHeroPower"
},
"druid":{
"displayName":"Druid",
"portaitImage":"druidPort",
"heroPowerImage":"druidHeroPower"
},
"mage":{
"displayName":"Mage",
"portaitImage":"magePort",
"heroPowerImage":"mageHeroPower"
},
"warlock":{
"displayName":"Warlock",
"portaitImage":"warlockPort",
"heroPowerImage":"warlockHeroPower"
}
},
"sets": {
"test": {
"neutral": {
Expand Down
8 changes: 7 additions & 1 deletion Assets/Scripts/PlayArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ public void DealRune(Rune rune, Action action)
GameObject go = Resources.Load<GameObject>(CARD_AVATAR_PREFAB_LOCATION);
go = GameObject.Instantiate(go);


go.name = card.GetName();
if(String.IsNullOrEmpty(card.GetName()))
{
go.name = "UnknowCard";
}
go.transform.position = new Vector3(6, yPos, -3);


Expand Down Expand Up @@ -333,6 +337,8 @@ public void SummonMinionRune(Rune rune, Action action)


go.transform.position = new Vector3(6, yPos, -3);

go.name = card.GetName();

string useGuid = Guid.NewGuid().ToString();

Expand Down
24 changes: 24 additions & 0 deletions Assets/Scripts/UI/HeroAvatar.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class HeroAvatar : MonoBehaviour {

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

// Use this for initialization
void Start () {

}

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

}



}

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

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

5 changes: 3 additions & 2 deletions Server/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function bootstrap(state) {
//foreach controller in the game
keys.forEach(function(element) {

var innerKeys = Object.keys(state.controllers);
var innerKeys = Object.keys(state.controllers);
//against them again
innerKeys.forEach(function (innerElement) {
//create the newControllerRune
Expand All @@ -425,7 +425,8 @@ function bootstrap(state) {
"controllerGuid":innerElement,
"controllerName":contr.name,
"type":contr.type,
"isMe":false
"isMe":false,
"hero":contr.hero.id
}
//If the one we are sending to, is the one we are creating the rune from, we tell them that, so they know who they are
if(contr == state.controllers[element])
Expand Down
48 changes: 48 additions & 0 deletions Server/heros/hunter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
var entity = require('../entityManager')
var heroUtil = require("../heroUtil");

exports.hero = {
"name":"Hunter",
"health":heroUtil.BASE_HERO_HEALTH,
"mana": 0,
"type":entity.HERO,
"power":{
"targetType":entity.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"
}

exports.attackPower = 2;

exports.canUse = function (heroController, targetController, state) {
var hero = state.controllers[heroController].hero;
var target = state.controllers[targetController].hero;

if(hero.mana >= hero.power.cost)
{
return true;
}
return false;
}

exports.validatePowerTarget = function (hero, target, state) {
if(target.type == entity.HERO)
{

}
}

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

exports.needMoreTargetInfo = function () {
return false;
}
//This is a for if an ability that self targets, IE, Hunter, Warlock, Paladin, Shaman
exports.getTarget = function (controller, state) {
var keys = Object.keys(state.controller);
}

0 comments on commit c997e07

Please sign in to comment.