本文整理汇总了C#中CharacterStats类的典型用法代码示例。如果您正苦于以下问题:C# CharacterStats类的具体用法?C# CharacterStats怎么用?C# CharacterStats使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CharacterStats类属于命名空间,在下文中一共展示了CharacterStats类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: handleInput
public override ControllState handleInput(BThirdPerson controller, CharacterStats stats)
{
if(controller.stateTime > 5.625){
}
return this;
}
示例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;
}
示例3: Start
public virtual void Start()
{
characterStats = gameObject.GetCharacterStats();
inventory = gameObject.GetInventory();
playerMotor = gameObject.GetPlayerMotor();
characterStats.Died += characterStats_Died;
}
示例4: Start
// Use this for initialization
void Start()
{
P1 = GameObject.FindGameObjectWithTag("Player1");
P2 = GameObject.FindGameObjectWithTag ("Player2");
playerHealth1 = P1.GetComponent<CharacterStats> ();
playerHealth2 = P2.GetComponent<CharacterStats> ();
}
示例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;
}
示例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;
}
示例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;
}
示例8: Awake
void Awake()
{
anim = GetComponent<Animator>();
cc = this.GetComponent<CharacterController>();
car = GetComponent<CharacterStats>();
shot = GetComponent<Shooting>();
}
示例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);
}
示例10: SubtractStats
public void SubtractStats(CharacterStats statsToSubtract)
{
swagger -= statsToSubtract.swagger;
strength -= statsToSubtract.strength;
agility -= statsToSubtract.agility;
mind -= statsToSubtract.mind;
health -= statsToSubtract.health;
}
示例11: AddStats
public void AddStats(CharacterStats statsToAdd)
{
swagger += statsToAdd.swagger;
strength += statsToAdd.strength;
agility += statsToAdd.agility;
mind += statsToAdd.mind;
health += statsToAdd.health;
}
示例12: Start
void Start()
{
anim = GetComponent<Animator>();
playerController = GetComponent<PlayerMovementController>();
characterStats = GetComponent<CharacterStats>();
colliderr = GetComponent<CapsuleCollider>();
characterControlInterface = GetComponent<CharacterControlInterface>();
}
示例13: Awake
void Awake()
{
stats = GetComponentInParent<CharacterStats>();
if (stats == null)
{
Debug.LogError("Can not found CharacterStats! " + this.gameObject.name);
}
}
示例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
}
示例15: Start
void Start()
{
characterStats = GetComponent<CharacterStats>();
characterStats.HPScaler *= hpScale;
characterStats.MovingSpeedModifier += movingSpeedModifier;
transform.localScale *= sizeScale;
}