void OnMouseEnter() { if (!_pointerClass) _pointerClass = _gameObject.GetComponent<C_LocationPointer>(); if (!_heroClass || !_heroGO || !_heroTran) { C_GameManager gameManagerClass = GameObject.Find("Game Manager").GetComponent<C_GameManager>(); _heroGO = gameManagerClass.z_thisPlayerGO; _heroClass = _heroGO.GetComponent<C_Hero>(); _heroTran = _heroGO.transform; } if (!_moveIconTran || !_moveIconRender) { _moveIconTran = GameObject.Find("Hero Move Icon").transform; _moveIconRender = _moveIconTran.GetComponent<Renderer>(); } if (_pointerClass.z_associatedWith != null) return; if ( ((C_Hero.CurrentStats) _heroClass.z_curStats).energy == 0 ) return; if ( C_LocationPointer.Z_InRange(_heroClass.z_associatedWith, _gameObject, 1, false) ) { _moveIconRender.enabled = true; _moveIconTran.position = _transform.position + (new Vector3(0,0.01f,0)); float angle = Vector3.Angle(Vector3.forward, _transform.position - _heroTran.position); int dir = Z_AngleDir(Vector3.forward, _transform.position - _heroTran.position, Vector3.up); if (dir != 0) angle *= dir; Vector3 eulerAngles = _moveIconTran.rotation.eulerAngles; eulerAngles.y = angle; _moveIconTran.rotation = Quaternion.Euler(eulerAngles); } }
void OnMouseEnter() { if (!_pointerClass) _pointerClass = _gameObject.GetComponent<C_LocationPointer>(); if (!_heroClass || !_heroGO || !_heroTran) { C_GameManager gameManagerClass = GameObject.Find("Game Manager").GetComponent<C_GameManager>(); _heroGO = gameManagerClass.z_thisPlayerGO; _heroClass = _heroGO.GetComponent<C_Hero>(); _heroTran = _heroGO.transform; } if (!_attackIconTran || !_attackIconTex) { _attackIconTran = GameObject.Find("Hero Attack Icon").transform; _attackIconTex = _attackIconTran.GetComponent<GUITexture>(); } if (_pointerClass.z_associatedWith == null) return; //if (_pointerClass.z_associatedWith.z_team == _heroClass.z_team) // return; if ( ((C_Hero.CurrentStats) _heroClass.z_curStats).energy == 0 ) return; if ( C_LocationPointer.Z_InRange(_heroClass.z_associatedWith, _gameObject, 1, false) ) { _attackIconTex.enabled = true; _attackIconTran.position = _camera.WorldToViewportPoint(_transform.position); } }
public void Z_UpdateMainBars(C_Hero.CurrentStats curStats) { int barSize = Mathf.FloorToInt( m_mainBarSize * (curStats.HP / curStats.maxHP) ); Rect pix = _hpMainTex.pixelInset; _hpMainTex.pixelInset = new Rect(pix.x, pix.y, barSize, pix.height); barSize = Mathf.FloorToInt( m_mainBarSize * (curStats.MP / curStats.maxMP) ); pix = _mpMainTex.pixelInset; _mpMainTex.pixelInset = new Rect(pix.x, pix.y, barSize, pix.height); }
//add concrette eff to stack in hero public abstract void addToEffStack(C_Hero h);
public override void addToEffStack(C_Hero h) { throw new NotImplementedException(); }
public void callScript(C_Hero user) { //retreat //fight end }
public override void callSkill(C_Hero user) { throw new NotImplementedException(); }
public deathUpMix3G(string _name, C_Hero h) { id = returnFreeId(h); name = _name; }
public healReP2M(string _name, C_Hero h) { id = returnFreeId(h); name = _name; }
//remove from stack by id public void removeEff(C_Hero h, int id) { h.effectsStorage.Remove(h.effectsStorage.Find(x => x.id == id)); }
public regENE(int _val, int _time, C_Hero h) { regValue = _val; time = _time; id = returnFreeId(h); }
public darknessUpMix2M(string _name, C_Hero h) { id = returnFreeId(h); name = _name; }
public override void use(C_Hero h) { h.currENE = h.maxENE; }
public CommandLevelChange(C_Hero _hero, PlusMinusButtonInputData _data) { hero = _hero; data = _data; }
public void callScript(C_Hero user) //data { //select talisman1 //select talsiman2 //recharge values }
public lightningUpMix1S(string _name, C_Hero h) { id = returnFreeId(h); name = _name; }
public override void callSkill(C_Hero user) { script.callScript(user); }
//add this to hero effectsStorage public override void addToEffStack(C_Hero h) { h.effectsStorage.Add(this); }
// public void calculateEff(C_Hero h) { }
//add this to hero eff_stack public override void addToEffStack(C_Hero h) { h.eff_stack.Add(this); }
public eneReP1S(string _name, C_Hero h) { id = returnFreeId(h); name = _name; }
public void callScript(C_Hero user) // and data from reader { //specifay effect data from datareader // add effect to user }
public void callScript(C_Hero user) // { // add effect to user }
public fireUpMix1S(string _name, C_Hero h) { id = returnFreeId(h); name = _name; }
// only for heroes public void callSkill(C_Hero user) { // call script script.callScript(user); }
public void callScript(C_Hero user) // info from data reader { //add effect to user }
public abstract void use(C_Hero h);
public physUpMix4U(string _name, C_Hero h) { id = returnFreeId(h); name = _name; }
public static bool buy(A_Item item, C_Hero hero) { int price = 0; switch (item.GetType().Name) { case "healP1S": price = 125; break; case "healP2M": price = 250; break; case "healP3G": price = 500; break; case "healP4U": price = 1000; break; case "healReP1S": price = 500; break; case "healReP2M": price = 1000; break; case "healReP3G": price = 2000; break; case "healReP4U": price = 4000; break; case "eneP1S": price = 200; break; case "eneP2M": price = 400; break; case "eneP3G": price = 800; break; case "eneP4U": price = 1600; break; case "eneReP1S": price = 500; break; case "eneReP2M": price = 1000; break; case "eneReP3G": price = 2000; break; case "eneReP4U": price = 4000; break; } if (price == 0) { string str = item.GetType().Name; str = str.Substring(str.Length - 2, 2); switch (str) { case "1S": price = 200; break; case "2M": price = 400; break; case "3G": price = 800; break; case "4U": price = 1600; break; } } if (hero.gold >= price) { hero.inv_items.Add(item); findid(hero); hero.gold -= price; return(true); } return(false); }
public LightUp(int _val, int _time, C_Hero h) { upValue = _val; time = _time; id = returnFreeId(h); }
public void callScript(C_Hero user) // and C_monster target? { //select monster //get info //write info into library... }
public lightUpMix2M(string _name, C_Hero h) { id = returnFreeId(h); name = _name; }
public CommandDefenceValueChange(C_Hero _hero, PlusMinusButtonInputData _data) { hero = _hero; data = _data; }