當前位置: 首頁>>代碼示例>>C#>>正文


C# Character.addBuff方法代碼示例

本文整理匯總了C#中Character.addBuff方法的典型用法代碼示例。如果您正苦於以下問題:C# Character.addBuff方法的具體用法?C# Character.addBuff怎麽用?C# Character.addBuff使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Character的用法示例。


在下文中一共展示了Character.addBuff方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Cast

    public override IEnumerator Cast(ArrayList objs)
    {
        GameObject caller = objs[1] as GameObject;
        GameObject target = objs[2] as GameObject;

        character = caller.GetComponent<Character>();
        enemy = target.GetComponent<Character>();

        character.castSkill("Skill30A_a");
        character.toward(enemy.transform.position);
        character.attackAnimaName = "Skill30A_b";

        if(character is Nebula){
            Nebula nebula = character as Nebula;
            nebula.showSkill30AHaloEftCallBack += showHaloEft;
            nebula.showSkill30ABulletEftCallBack += showBulletEft;
        }else if(character is Ch2_Nebula){
            Ch2_Nebula nebula = character as Ch2_Nebula;
            nebula.showSkill30AHaloEftCallBack += showHaloEft;
            nebula.showSkill30ABulletEftCallBack += showBulletEft;
        }

        SkillDef skillDef = SkillLib.instance.getSkillDefBySkillID("NEBULA30A");
        int buffTime = (int)skillDef.buffDurationTime;
        int tempAtk = (int)((Effect)skillDef.activeEffectTable["atk_PHY"]).num;
        int tempAspd = (int)((Effect)skillDef.activeEffectTable["aspd"]).num;

        character.addBuff("Skill_NEBULA30A",buffTime,tempAtk,BuffTypes.ATK_PHY,buffFinish);
        character.addBuff("Skill_NEBULA30A",buffTime,tempAspd,BuffTypes.ASPD);

        yield return new WaitForSeconds(1f);

        createBgFire();
    }
開發者ID:rogeryuan99,項目名稱:Hello,代碼行數:34,代碼來源:Skill_NEBULA30A.cs

示例2: showSkill15BEft

    public void showSkill15BEft(Character character)
    {
        Bug bug = character as Bug;

        bug.showSkill15BEftCallback -= showSkill15BEft;

        float skillEftX = 0;
        float haloEftX = 0;
        if(character.model.transform.localScale.x > 0)
        {
            skillEftX = 244;
            haloEftX = 273.1709f;
        }
        else
        {
            skillEftX = -297;
            haloEftX = -277.1709f;
        }

        GameObject skillEft = null;
        StaticData.createObjFromPrb(ref skillEftPrb, "eft/Bug/SkillEft_BUG15B_Eft", ref skillEft, character.transform, new Vector3(skillEftX, 84, 0));

        GameObject haloEft = null;
        StaticData.createObjFromPrb(ref haloEftPrb, "eft/Bug/SkillEft_BUG15B_HaloEft", ref haloEft, character.transform, new Vector3(haloEftX, 0, 0));
        //		Debug.Break();

        SkillDef skillDef = SkillLib.instance.allHeroSkillHash["BUG15B"] as SkillDef;

        float per = ((Effect)skillDef.buffEffectTable["atk_PHY"]).num;

        character.addBuff("Skill_BUG15B", skillDef.buffDurationTime, per, BuffTypes.ATK_PHY, buffFinish);
    }
開發者ID:rogeryuan99,項目名稱:Hello,代碼行數:32,代碼來源:Skill_BUG15B.cs

示例3: showSkill25APassive

 public void showSkill25APassive(Character c)
 {
     SkillDef skillDef = SkillLib.instance.getSkillDefBySkillID("NEBULA25A");
     int tempHp = (int)skillDef.passiveEffectTable["universal"];
     float hp = c.realMaxHp * ((float)tempHp / 100.0f);
     int time = (int)(100f/(float)tempHp);
     c.addBuff("Skill_NEBULA25A", time, hp, BuffTypes.DE_HP, buffFinish);
     c.changeStateColor(new Color(1f, 1f, 1f, 1f), new Color(.5f, .5f, .5f, 1f), .05f);
 }
開發者ID:rogeryuan99,項目名稱:Hello,代碼行數:9,代碼來源:Ch2_Nebula.cs

示例4: Cast

    public override IEnumerator Cast(ArrayList objs)
    {
        GameObject caller = objs[1] as GameObject;

        character = caller.GetComponent<Character>();
        character.castSkill("Skill30A_a");
        character.attackAnimaName = "Skill30A_b";

        SkillDef skillDef = SkillLib.instance.getSkillDefBySkillID("SKUNGE30A");
        int buffTime = (int)skillDef.skillDurationTime;
        character.addBuff("Skill_SKUNGE30A",buffTime,0,BuffTypes.ATK_PHY,buffFinish);

        yield return new WaitForSeconds(0f);
    }
開發者ID:rogeryuan99,項目名稱:Hello,代碼行數:14,代碼來源:Skill_SKUNGE30A.cs

示例5: Skill_DRAX5BEffect

    public void Skill_DRAX5BEffect(Drax drax, Character target)
    {
        if(target.getIsDead())
        {
            return;
        }
        drax.attackAnimaEvent -= Skill_DRAX5BEffect;

        Debug.LogError("Skill_DRAX5BEffect");

        SkillDef skillDef = SkillLib.instance.getSkillDefBySkillID("DRAX5B");

        Hashtable tempNumber = skillDef.activeEffectTable;
        int time = skillDef.buffDurationTime;
        float per = ((Effect)skillDef.buffEffectTable["hp"]).num;
        int hp = (int)((per / 100.0f + 1.0f) * drax.realMaxHp);
        target.addBuff("Skill_DRAX5B", time, (float)hp/(float)time, BuffTypes.DE_HP);

        DestroyBuffEft(drax, "Skill_DRAX5B");
    }
開發者ID:rogeryuan99,項目名稱:Hello,代碼行數:20,代碼來源:Skill_DRAX5B.cs

示例6: Cast

    public override IEnumerator Cast(ArrayList objs)
    {
        GameObject caller = objs[1] as GameObject;
        GameObject target = objs[2] as GameObject;

        yield return new WaitForSeconds(0.5f);

        character = caller.GetComponent<Character>();

        if(character is Caiera)
        {
            Caiera caiera = character as Caiera;
            caiera.showSkill30BHaloEftCallback += showSkill30BShowHaloEft;

        }
        else if(character is Ch3_Caiera)
        {
            Ch3_Caiera caiera = character as Ch3_Caiera;
            caiera.showSkill30BHaloEftCallback += showSkill30BShowHaloEft;
        }

        character.castSkill("Skill30B");

        SkillDef skillDef = SkillLib.instance.allHeroSkillHash["CAIERA30B"] as SkillDef;

        int buffime = skillDef.buffDurationTime;

        character.hurtBeforeState = Character.HurtBeforeState.NOTHURT;

        character.realAtk.ENG = character.realAtk.PHY;
        character.realAtk.PHY = 0;

        character.addBuff("Skill_CAIERA30B", buffime, 0, BuffTypes.DEF_PHY, buffFinish);

        StaticData.createObjFromPrb(ref firstFirePrb, "eft/Caiera/Skill_CAIERA30B_FirstFire", ref firstFire, character.transform, new Vector3(0, 0, 1));

        firstFire.GetComponent<PackedSprite>().SetAnimCompleteDelegate(showSecondFire);

        MusicManager.playEffectMusic("SFX_Caiera_Shadow_Warrior_1a");
    }
開發者ID:rogeryuan99,項目名稱:Hello,代碼行數:40,代碼來源:Skill_CAIERA30B.cs

示例7: Skill_DRAX30AEffect

    public void Skill_DRAX30AEffect(Drax drax, Character target)
    {
        MusicManager.playEffectMusic("SFX_Drax_The_Destroyer_1a");
        SkillDef skillDef = SkillLib.instance.getSkillDefBySkillID("DRAX30A");
        int skillDurationTime = skillDef.skillDurationTime;
        int buffDurationTime = skillDef.buffDurationTime;
        Hashtable buffTable = skillDef.buffEffectTable;

        float per = ((Effect)buffTable["hp"]).num;
        int hp = (int)(target.realMaxHp * (per / 100.0f));

        if(StaticData.computeChance(50, 100))
        {
            target.addBuff("Skill_DRAX30A_DE_HP", buffDurationTime, hp / buffDurationTime, BuffTypes.DE_HP);
        //			target.layDownWithSeconds();

            State s = new State(skillDurationTime, null);
            target.addAbnormalState(s, Character.ABNORMAL_NUM.LAYDOWN);
        }

        target.defenseAtk(drax.realAtk, drax.gameObject);
    }
開發者ID:rogeryuan99,項目名稱:Hello,代碼行數:22,代碼來源:Skill_DRAX30A.cs


注:本文中的Character.addBuff方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。