• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CharacterStats类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CharacterStats的典型用法代码示例。如果您正苦于以下问题:C# CharacterStats类的具体用法?C# CharacterStats怎么用?C# CharacterStats使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CharacterStats类属于命名空间,在下文中一共展示了CharacterStats类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: handleInput

    public override ControllState handleInput(BThirdPerson controller, CharacterStats stats)
    {
        if(controller.stateTime > 5.625){

        }
        return this;
    }
开发者ID:FabianSchempp,项目名称:DUNDON,代码行数:7,代码来源:ControllStateCrow.cs


示例2: mod_SetButtonsAnticlassSpells

        public void mod_SetButtonsAnticlassSpells(CharacterStats stats)
        {
            this.Label = null;
            int num = 0;
            foreach (GenericAbility current in stats.Abilities)
            {
                if (current is GenericSpell)
                {
                    CharacterStats.Class spellClass = ((GenericSpell)current).SpellClass;
                    if (spellClass != stats.CharacterClass || !CharacterStats.IsPlayableClass(spellClass))
                    {

                        if ((stats.CharacterClass == CharacterStats.Class.Wizard ||
                            stats.CharacterClass == CharacterStats.Class.Priest ||
                            stats.CharacterClass == CharacterStats.Class.Druid ||
                            stats.CharacterClass == CharacterStats.Class.Chanter ||
                            stats.CharacterClass == CharacterStats.Class.Cipher) && IEModOptions.HideAnticlassSpells)
                        {

                        }

                        else
                        {
                            this.SetButton(num, current.gameObject, UIAbilityBarButtonSet.AbilityButtonAction.CAST_SPELL_ABILITY, current.Icon);
                            num++;
                        }
                    }
                }
            }
            this.HideButtons(num);
            this.m_DoRefresh = true;
        }
开发者ID:tjayharvey,项目名称:IEMod.pw,代码行数:32,代码来源:mod_UIAbilityBarButtonSet.cs


示例3: Start

 public virtual void Start()
 {
     characterStats = gameObject.GetCharacterStats();
     inventory = gameObject.GetInventory();
     playerMotor = gameObject.GetPlayerMotor();
     characterStats.Died += characterStats_Died;
 }
开发者ID:BrendanMulcahy,项目名称:IronStrife,代码行数:7,代码来源:DamageReceiver.cs


示例4: Start

 // Use this for initialization
 void Start()
 {
     P1 = GameObject.FindGameObjectWithTag("Player1");
     P2 = GameObject.FindGameObjectWithTag ("Player2");
     playerHealth1 = P1.GetComponent<CharacterStats> ();
     playerHealth2 = P2.GetComponent<CharacterStats> ();
 }
开发者ID:JELGT2011,项目名称:Wizards-Of-Dos,代码行数:8,代码来源:TriggerPoints.cs


示例5: handleInput

    public override ControllState handleInput(BThirdPerson controller, CharacterStats stats)
    {
        Vector3 mousePoint = Vector3.zero;
        stats.healthRegenerationRate = 0f;
        stats.enduranceRegenerationRate = 0f;

        if(controller.stateTime < 0.1){
            controller.turnToReferenceObject();
            controller.controller.slotRightHand.GetComponent<OWeapon>().enable();
            shot = false;
        }

        if(Random.Range(1,10) < 3){
            shot = true;
        }

        if(controller.stateTime > 0.22f){
            if(shot){
                return ControllerZombie._ZombieATTACKB;
            }
            else{
                controller.controller.slotRightHand.GetComponent<OWeapon>().disable();
                return ControllerZombie._ZombieIDLE;
            }
        }

        return this;
    }
开发者ID:FabianSchempp,项目名称:DUNDON,代码行数:28,代码来源:ControllStateZombie.cs


示例6: Slime

    public static Character Slime()
    {
        var character = new Character();

        var baseStats = new CharacterStats();
        baseStats.SetStat(Const.Stats.MaxHp, 700d);
        baseStats.SetStat(Const.Stats.MaxMp, 150d);
        baseStats.SetStat(Const.Stats.Attack, 300d);
        baseStats.SetStat(Const.Stats.Defense, 150d);
        baseStats.SetStat(Const.Stats.Wisdom, 70d);
        baseStats.SetStat(Const.Stats.Agility, 100d);
        baseStats.SetStat(Const.Stats.Mind, 50d);
        baseStats.SetStat(Const.Stats.Critical, 0.05d);
        baseStats.SetStat(Const.Stats.Accuracy, 0.8d);
        baseStats.SetStat(Const.Stats.Evasion, 0.1d);

        character.Name = "Slime";
        character.BaseStats = baseStats;

        character.PortraitPath = "Characters/Slime/portrait";
        character.ModelPath = "Characters/Slime/model";
        character.AttackDistance = 2.5f;
        character.SizeOffset = 1.5f;
        character.Skills.Add(Skill.MeleeAttack());
        character.Movement = 2;

        character.PatternShape = Pattern.Single();

        return character;
    }
开发者ID:sucineri,项目名称:Battle-Project,代码行数:30,代码来源:Character.cs


示例7: handleInput

    public override ControllState handleInput(BThirdPerson controller, CharacterStats stats)
    {
        Vector3 mousePoint = Vector3.zero;
        stats.healthRegenerationRate = 0f;
        stats.enduranceRegenerationRate = 0f;

        if(controller.stateTime < 0.1){
            controller.controller.slotRightHand.GetComponent<OWeapon>().enable();
            shot = false;
            Vector2 inputVector = new Vector2(Input.GetAxis("Horizontal"),Input.GetAxis("Vertical"));
            Vector3 inputVectorTransformed = new Vector3(inputVector.x,0,-inputVector.y);
            Vector3 lookTarget = controller.position + (ControllerCamera.hingeUp.transform.rotation*inputVectorTransformed);
            controller.turn(lookTarget);
        }

        if(Input.GetButtonDown("attack") && stats.reduceEndurance(7) && !shot){
            shot = true;
        }

        if(controller.stateTime > 0.22f){
            if(shot){
                return ControllerKnight._KnightATTACKB;
            }
            else{
                controller.controller.slotRightHand.GetComponent<OWeapon>().disable();
                return ControllerKnight._KnightIDLE;
            }
        }

        return this;
    }
开发者ID:FabianSchempp,项目名称:DUNDON,代码行数:31,代码来源:ControllStateKnight.cs


示例8: Awake

 void Awake()
 {
     anim = GetComponent<Animator>();
     cc = this.GetComponent<CharacterController>();
     car = GetComponent<CharacterStats>();
     shot = GetComponent<Shooting>();
 }
开发者ID:Torppo,项目名称:IntramuralRPG,代码行数:7,代码来源:PlayerMovement.cs


示例9: mod_ShowOnSpellBar

        public static bool mod_ShowOnSpellBar(GenericAbility ability, CharacterStats stats, int spellLevel)
        {
            if (ability.Passive)
            {
                return false;
            }
            GenericSpell genericSpell = ability as GenericSpell;
            GenericCipherAbility genericCipherAbility = ability as GenericCipherAbility;
            if (!genericSpell)
            {
                return genericCipherAbility && (spellLevel <= 0 || genericCipherAbility.SpellLevel == spellLevel);
            }

            if (genericSpell.SpellClass != stats.CharacterClass && spellLevel > 0 && genericSpell.SpellLevel == spellLevel && IEModOptions.HideAnticlassSpells)
            {
                return true;
            }

            if (genericSpell.SpellClass != stats.CharacterClass || (spellLevel > 0 && genericSpell.SpellLevel != spellLevel))
            {
                return false;
            }
            if (stats.CharacterClass != CharacterStats.Class.Wizard || !genericSpell.NeedsGrimoire)
            {
                return true;
            }
            Equipment component = stats.GetComponent<Equipment>();
            if (component == null || component.CurrentItems == null || component.CurrentItems.Grimoire == null)
            {
                return false;
            }
            Grimoire component2 = component.CurrentItems.Grimoire.GetComponent<Grimoire>();
            return !(component2 == null) && component2.HasSpell(genericSpell);
        }
开发者ID:tjayharvey,项目名称:IEMod.pw,代码行数:34,代码来源:mod_UIAbilityBarButtonSet.cs


示例10: SubtractStats

 public void SubtractStats(CharacterStats statsToSubtract)
 {
     swagger -= statsToSubtract.swagger;
     strength -= statsToSubtract.strength;
     agility -= statsToSubtract.agility;
     mind -= statsToSubtract.mind;
     health -= statsToSubtract.health;
 }
开发者ID:ullizei,项目名称:pirates,代码行数:8,代码来源:CharacterStats.cs


示例11: AddStats

 public void AddStats(CharacterStats statsToAdd)
 {
     swagger += statsToAdd.swagger;
     strength += statsToAdd.strength;
     agility += statsToAdd.agility;
     mind += statsToAdd.mind;
     health += statsToAdd.health;
 }
开发者ID:ullizei,项目名称:pirates,代码行数:8,代码来源:CharacterStats.cs


示例12: Start

    void Start()
    {
        anim = GetComponent<Animator>();
        playerController = GetComponent<PlayerMovementController>();
        characterStats = GetComponent<CharacterStats>();
        colliderr = GetComponent<CapsuleCollider>();

        characterControlInterface = GetComponent<CharacterControlInterface>();
    }
开发者ID:Hoon-Park,项目名称:MMOArenaUnity,代码行数:9,代码来源:AnimationController.cs


示例13: Awake

    void Awake()
    {
        stats = GetComponentInParent<CharacterStats>();

        if (stats == null)
        {
            Debug.LogError("Can not found CharacterStats! " + this.gameObject.name);
        }
    }
开发者ID:t1mmmmY,项目名称:SeaDogs,代码行数:9,代码来源:BodyPart.cs


示例14: Awake

    Vector3 greenPos; //Position of the health bar relative to the character

    #endregion Fields

    #region Methods

    void Awake()
    {
        //loads enemy health value from healthScript
        healthScript = transform.parent.gameObject.GetComponent<CharacterStats>();
        curHealth = healthScript.health;
        maxHealth = healthScript.maxHealth;

        //stores two health values, will come in later
    }
开发者ID:Torppo,项目名称:IntramuralRPG,代码行数:15,代码来源:EnemyHealth.cs


示例15: Start

    void Start()
    {
        characterStats = GetComponent<CharacterStats>();

        characterStats.HPScaler *= hpScale;
        characterStats.MovingSpeedModifier += movingSpeedModifier;

        transform.localScale *= sizeScale;
    }
开发者ID:tobygameac,项目名称:2015AR,代码行数:9,代码来源:Strongger.cs


示例16: Start

    //private Text text;
    void Start()
    {
        characterStats = character.GetComponent<CharacterStats>();
        HPBarRectTransform = HPBarImage.GetComponent<RectTransform>();
        originalSize = HPBarRectTransform.sizeDelta;
        originalLocalPosition = HPBarRectTransform.localPosition;

        //text = HPBarText.GetComponent<Text>();
    }
开发者ID:tobygameac,项目名称:2015AR,代码行数:10,代码来源:CharacterHPBar.cs


示例17: GetCurrentBonusMultiplierNew

		public float GetCurrentBonusMultiplierNew(CharacterStats stats, GenericAbility abilityOrigin)
		{
			if (stats == null)
			{
				return 1f;
			}
			float bonus = 0f;
			if (IEModOptions.NPCDispositionFix || (GameState.s_playerCharacter != null && stats.gameObject == GameState.s_playerCharacter.gameObject)) // added ((Mod_GameOptions_GameMode)GameState.Mode).NPCDispositionFix || 
			{
				float single = 1f;
				if (abilityOrigin != null)
				{
					single = single * abilityOrigin.GatherAbilityModProduct(AbilityMod.AbilityModType.NegativeReligiousTraitMultiplier);
				}
				if (stats.CharacterClass == CharacterStats.Class.Priest)
				{
					global::Religion.DeityData deityDatum = this.FindDeityData(stats.Deity);
					if (deityDatum != null)
					{
						bonus = bonus + this.GetBonus(deityDatum.PositiveTrait[0], this.PositiveTraitBonus);
						bonus = bonus + this.GetBonus(deityDatum.PositiveTrait[1], this.PositiveTraitBonus);
						bonus = bonus + this.GetBonus(deityDatum.NegativeTrait[0], this.NegativeTraitBonus) * single;
						bonus = bonus + this.GetBonus(deityDatum.NegativeTrait[1], this.NegativeTraitBonus) * single;
					}
				}
				else if (stats.CharacterClass == CharacterStats.Class.Paladin)
				{
					global::Religion.PaladinOrderData paladinOrderDatum = this.FindPaladinOrderData(stats.PaladinOrder);
					if (paladinOrderDatum != null)
					{
						/* patching in dis/favored dispositions for Pallegina's order */
						if (stats.PaladinOrder == PaladinOrder.FrermasMesCancSuolias)
						{
							var favored1 = IEModOptions.PalleginaFavored1;
							var favored2 = IEModOptions.PalleginaFavored2;
							var disfavored1 = IEModOptions.PalleginaDisfavored1;
							var disfavored2 = IEModOptions.PalleginaDisfavored2;

							paladinOrderDatum.PositiveTrait = new Disposition.Axis[2];
							paladinOrderDatum.PositiveTrait[0] = favored1;
							paladinOrderDatum.PositiveTrait[1] = favored2;
							paladinOrderDatum.NegativeTrait = new Disposition.Axis[2];
							paladinOrderDatum.NegativeTrait[0] = disfavored1;
							paladinOrderDatum.NegativeTrait[1] = disfavored2;
						}
						/**************************************************************************************/

						bonus = bonus + this.GetBonus(paladinOrderDatum.PositiveTrait[0], this.PositiveTraitBonus);
						bonus = bonus + this.GetBonus(paladinOrderDatum.PositiveTrait[1], this.PositiveTraitBonus);
						bonus = bonus + this.GetBonus(paladinOrderDatum.NegativeTrait[0], this.NegativeTraitBonus) * single;
						bonus = bonus + this.GetBonus(paladinOrderDatum.NegativeTrait[1], this.NegativeTraitBonus) * single;
					}
				}
			}
			bonus = bonus + 1f;
			return bonus;
		}
开发者ID:Bigtuna00,项目名称:IEMod.pw,代码行数:57,代码来源:Mod_Religion.cs


示例18: Clone

 public CharacterStats Clone()
 {
     var clone = new CharacterStats();
     foreach (var key in this._stats.Keys)
     {
         clone._stats[key] = this._stats[key];
     }
     return clone;
 }
开发者ID:sucineri,项目名称:Battle-Project,代码行数:9,代码来源:CharacterStats.cs


示例19: Start

	// Use this for initialization

	void Start () {
		ownColor = gameObject.GetComponent<SpriteRenderer>().color;
		_myStats = new CharacterStats(gameObject.tag.ToString());
		if( _myStats.load() ){
			hp = _myStats.getHp();
			exp = _myStats.getExp();
			coin = _myStats.getCoin();
			max_hp = hp;
		}
	}
开发者ID:spytroll33,项目名称:roguelike,代码行数:12,代码来源:BodyStatus.cs


示例20: Start

    void Start()
    {
        if (gameManager == null) {
          gameManager = Camera.main.GetComponent<GameManager>();
        }

        characterStats = GetComponent<CharacterStats>();

        previousHP = characterStats.MaxHP;
    }
开发者ID:tobygameac,项目名称:2015AR,代码行数:10,代码来源:Enemy.cs



注:本文中的CharacterStats类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CharacterType类代码示例发布时间:2022-05-24
下一篇:
C# CharacterState类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap