コード例 #1
0
    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);
        }
    }
コード例 #2
0
    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);
        }
    }
コード例 #3
0
    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);
    }
コード例 #4
0
ファイル: A_Effect.cs プロジェクト: Sanchoserik/Adventure
 //add concrette eff to stack in hero
 public abstract void addToEffStack(C_Hero h);
コード例 #5
0
ファイル: lightUp.cs プロジェクト: Sanchoserik/Adventure
 public override void addToEffStack(C_Hero h)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
 public void callScript(C_Hero user)
 {
     //retreat
     //fight end
 }
コード例 #7
0
 public override void callSkill(C_Hero user)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public deathUpMix3G(string _name, C_Hero h)
 {
     id   = returnFreeId(h);
     name = _name;
 }
コード例 #9
0
 public healReP2M(string _name, C_Hero h)
 {
     id   = returnFreeId(h);
     name = _name;
 }
コード例 #10
0
ファイル: A_Effect.cs プロジェクト: Sanchoserik/Adventure
 //remove from stack by id
 public void removeEff(C_Hero h, int id)
 {
     h.effectsStorage.Remove(h.effectsStorage.Find(x => x.id == id));
 }
コード例 #11
0
 public regENE(int _val, int _time, C_Hero h)
 {
     regValue = _val;
     time     = _time;
     id       = returnFreeId(h);
 }
コード例 #12
0
 public darknessUpMix2M(string _name, C_Hero h)
 {
     id   = returnFreeId(h);
     name = _name;
 }
コード例 #13
0
 public override void use(C_Hero h)
 {
     h.currENE = h.maxENE;
 }
コード例 #14
0
 public CommandLevelChange(C_Hero _hero, PlusMinusButtonInputData _data)
 {
     hero = _hero;
     data = _data;
 }
コード例 #15
0
ファイル: as_Recharge.cs プロジェクト: Sanchoserik/Adventure
 public void callScript(C_Hero user) //data
 {
     //select talisman1
     //select talsiman2
     //recharge values
 }
コード例 #16
0
 public lightningUpMix1S(string _name, C_Hero h)
 {
     id   = returnFreeId(h);
     name = _name;
 }
コード例 #17
0
 public override void callSkill(C_Hero user)
 {
     script.callScript(user);
 }
コード例 #18
0
ファイル: regHP.cs プロジェクト: Sanchoserik/Adventure
 //add this to hero effectsStorage
 public override void addToEffStack(C_Hero h)
 {
     h.effectsStorage.Add(this);
 }
コード例 #19
0
ファイル: A_Effect.cs プロジェクト: Sanchoserik/Adventure
 //
 public void calculateEff(C_Hero h)
 {
 }
コード例 #20
0
 //add this to hero eff_stack
 public override void addToEffStack(C_Hero h)
 {
     h.eff_stack.Add(this);
 }
コード例 #21
0
 public eneReP1S(string _name, C_Hero h)
 {
     id   = returnFreeId(h);
     name = _name;
 }
コード例 #22
0
 public void callScript(C_Hero user) // and data from reader
 {
     //specifay effect data from datareader
     // add effect to user
 }
コード例 #23
0
 public void callScript(C_Hero user) //
 {
     // add effect to user
 }
コード例 #24
0
 public fireUpMix1S(string _name, C_Hero h)
 {
     id   = returnFreeId(h);
     name = _name;
 }
コード例 #25
0
 // only for heroes
 public void callSkill(C_Hero user)
 {
     // call script
     script.callScript(user);
 }
コード例 #26
0
 public void callScript(C_Hero user) // info from data reader
 {
     //add effect to user
 }
コード例 #27
0
 public abstract void use(C_Hero h);
コード例 #28
0
 public physUpMix4U(string _name, C_Hero h)
 {
     id   = returnFreeId(h);
     name = _name;
 }
コード例 #29
0
        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);
        }
コード例 #30
0
ファイル: lightUp.cs プロジェクト: Sanchoserik/Adventure
 public LightUp(int _val, int _time, C_Hero h)
 {
     upValue = _val;
     time    = _time;
     id      = returnFreeId(h);
 }
コード例 #31
0
 public void callScript(C_Hero user) // and C_monster target?
 {
     //select monster
     //get info
     //write info into library...
 }
コード例 #32
0
 public lightUpMix2M(string _name, C_Hero h)
 {
     id   = returnFreeId(h);
     name = _name;
 }
コード例 #33
0
 public CommandDefenceValueChange(C_Hero _hero, PlusMinusButtonInputData _data)
 {
     hero = _hero;
     data = _data;
 }