コード例 #1
0
    public override void OnInspectorGUI()
    {
        // Create a character reference
        CharacterAttributes character = (CharacterAttributes)target;

        // Popup selection to choose what class
        // Added the assignment to fix the error
        character.classType = (CharacterAttributes.ClassType)EditorGUILayout.EnumPopup("Class", character.classType, EditorStyles.popup);


        // Int field to set the value of experience
        character.experience = EditorGUILayout.IntField("Experience", character.experience);

        // Label field to show what the level is based on the amount of exp
        EditorGUILayout.LabelField("Level", character.level.ToString());

        // Attribute label
        EditorGUILayout.PrefixLabel("Attributes:");
        EditorGUI.indentLevel++;

        // Sliders to adjust the values for endurance, speed, and knowledge
        character.endurance = EditorGUILayout.IntSlider(new GUIContent("Endurance"), character.endurance, attributeMin, attributeMax);
        EditorGUILayout.LabelField("HP", character.maxHP.ToString());

        character.knowledge = EditorGUILayout.IntSlider(new GUIContent("Knowledge"), character.knowledge, attributeMin, attributeMax);
        EditorGUILayout.LabelField("MP", character.maxMP.ToString());

        character.speed = EditorGUILayout.IntSlider(new GUIContent("Speed"), character.speed, attributeMin, attributeMax);
        EditorGUILayout.LabelField("Evasion", character.maxEvasion.ToString());

        EditorGUI.indentLevel--;
    }
コード例 #2
0
    private void Awake()
    {
        idleState   = new IdleState(this);
        moveState   = new MoveState(this);
        attackState = new AttackState(this);
        castState   = new CastState(this);
        fleeState   = new FleeState(this);
        defendState = new DefendState(this);

        anim            = GetComponent <Animator>();
        walkSpeed       = 1.0f;
        navMeshAgent    = GetComponent <NavMeshAgent>();
        navSpeedDefault = navMeshAgent.speed;

        eyes          = transform.FindChild("Eyes");
        sightCollider = GetComponent <SphereCollider>();
        tm            = GameObject.FindWithTag("TeamManager").GetComponent <TeamManager>();
        ah            = GameObject.FindWithTag("AbilityHelper").GetComponent <AbilityHelper>();

        //this is a mess. These are "shared" variables between co-op ai and player script
        player         = GetComponent <Player>();
        animController = player.animController;
        abilities      = player.abilities;
        attributes     = player.attributes;
        watchedEnemies = player.watchedEnemies;
        visibleEnemies = player.visibleEnemies;
    }
コード例 #3
0
    // =============================| GETTING STATISTICS |======================================== //
    public float GetKillPercent(CharacterAttributes Attribute)
    {
        float SwitchKilled = GetKillPercent_Switch(Attribute);
        float StayKilled   = GetKillPercent_Stay(Attribute);

        return((SwitchKilled + StayKilled) / 2);
    }
コード例 #4
0
 //Constructor with inputs, att for attribute, value for strength, durat for duration, period for period, eff for effects, reverse for reverseOnRemove
 public PeriodicTemporaryEffect(string name, CharacterAttributes att, int value, int durat, int period, ImmediateEffect[] eff, bool reverse, bool isDmg = true, bool affectedByArmor = true, int num = 0, int sides = 0)
     : base(name, att, value, CharacterAttributes.Zero, durat, 0f, isDmg, affectedByArmor, num, sides)
 {
     this.period     = period;
     effects         = eff;
     reverseOnRemove = reverse;
 }
コード例 #5
0
    protected virtual IEnumerator WaitSkillCooltime()
    {
        UIManager.Instance.UsePlayerSkill(this);

        if (attributes == null)
        {
            attributes = GameManager.instance.player.GetComponent <CharacterAttributes>();
        }

        if (attributes.SearchPerk(2007) != null)
        {
            attributes.AddBuff("Switch ON", attributes.gameObject);
        }

        while (true)
        {
            yield return(new WaitForSeconds(0.1f));

            cooltimeCheck += 0.1f;

            if (cooltimeCheck >= cooltime)
            {
                enable = true;
                break;
            }
        }
        cooltimeCheck = 0f;

        yield return(null);
    }
コード例 #6
0
    // Update is called once per frame
    void Update()

    {
        GameObject          enemy        = FindClosestEnemy();
        CharacterAttributes myAttributes = this.GetComponent <CharacterAttributes>();

        if (Vector2.Distance(enemy.transform.position, transform.position) > myAttributes.attackDist)
        {
            transform.position = Vector3.MoveTowards(transform.position, enemy.transform.position, movementSpeed);
            print(enemy.transform.position);
        }
        else
        {
            if (Time.time > nextDamgeEvent)
            {
                CharacterAttributes enemyHealth = enemy.GetComponent <CharacterAttributes>();
                enemyHealth.Health -= myAttributes.attackDam;
                nextDamgeEvent      = Time.time + myAttributes.attackDelay;
                if (enemyHealth.Health < 0)
                {
                    Destroy(enemy);
                }
            }
        }
    }
コード例 #7
0
ファイル: TeamManager.cs プロジェクト: jishclurk/CapstoneGame
    public SerializedPlayer[] currentState()
    {
        SerializedPlayer[] players = new SerializedPlayer[playerList.Count];
        for (int i = 0; i < playerList.Count; i++)
        {
            CharacterAttributes current = playerList[i].attributes;
            SerializedPlayer    player  = new SerializedPlayer();
            player.level        = current.Level;
            player.experience   = current.Experience;
            player.strength     = current.Strength;
            player.intelligence = current.Intelligence;
            player.stamina      = current.Stamina;
            player.isInControl  = playerList[i].Equals(activePlayer);
            player.id           = playerList[i].id;
            player.statPoints   = current.StatPoints;
            players[i]          = player;
            player.health       = playerList[i].resources.currentHealth;
            player.energy       = playerList[i].resources.currentEnergy;
            int[] abilities = new int[4];
            for (int j = 0; j < playerList[i].abilities.abilityArray.Length; j++)
            {
                IAbility ability = playerList[i].abilities.abilityArray[j];
                abilities[j] = ability.id;
            }
            player.abilities = abilities;
            player.basic     = playerList[i].abilities.Basic.id;
        }

        return(players);
    }
コード例 #8
0
        public void MinusNullTest()
        {
            CharacterAttributes testData = null;
            Action minus = () => { var e = -testData; };

            minus.ShouldThrow <NullReferenceException>();
        }
コード例 #9
0
    // Use this for initialization
    void Awake()
    {
        localEventManager              = new LocalEventManager();
        physicsManager                 = transform.Find("DownCollider").GetComponent <PhysicsManager>();
        physicsManager.character       = gameObject;
        characterAttributes            = GetComponent <CharacterAttributes>();
        inputManager                   = GetComponent <InputManager>();
        inputManager.localEventManager = localEventManager;
        if (Type != CharacterType.Player)
        {
            transform.Find("UpBody").GetComponent <AudioListener>().enabled = false;
            inputManager.enabled = false;
        }
        switch (Type)
        {
        case CharacterType.Player:
            character          = new Player(gameObject);
            GameManager.Player = transform.Find("DownCollider").gameObject;
            break;

        case CharacterType.Enemy:
            character = new Enemy(gameObject);
            break;
        }
    }
コード例 #10
0
 public CharacterBase(GameObject This)
 {
     characterObj        = This;
     UpBody              = This.transform.Find("UpBody").gameObject;
     DownCollider        = This.transform.Find("DownCollider").gameObject;
     UpperAnim           = This.transform.Find("UpBody/Upper").GetComponent <Animation>();
     FeetAnim            = This.transform.Find("UpBody/Upper/Feet").GetComponent <Animation>();
     HeadSprite          = This.transform.Find("UpBody/Upper/Head").GetComponent <SpriteRenderer>();
     BodySprite          = This.transform.Find("UpBody/Upper/Body").GetComponent <SpriteRenderer>();
     characterAttributes = This.GetComponent <CharacterAttributes>();
     localEventManager   = This.GetComponent <CharacterManager>().localEventManager;
     equipmentStatus     = new EquipmentStatus("EmptyHand", "Small")
     {
         Range = new Vector2(1, 1)
     };
     characterStatus = new InAir(this, "Normal");
     characterStatus.Enter();
     EventManager.eventManager.DamageCheckEvent += DamageCheck;
     localEventManager.ChangeToAirEvent         += ChangeToAir;
     localEventManager.ChangeToGroundEvent      += ChangeToGround;
     localEventManager.JumpEvent             += Jump;
     localEventManager.MoveEvent             += Move;
     localEventManager.AttackEvent           += Attack;
     localEventManager.JumpLeftwardEvent     += JumpLeftward;
     localEventManager.JumpRightwardEvent    += JumpRightward;
     localEventManager.DodgeLeftwardEvent    += DodgeLeftward;
     localEventManager.DodgeRightwardEvent   += DodgeRightward;
     localEventManager.ThrowLeftwardEvent    += ThrowLeftward;
     localEventManager.ThrowRightwardEvent   += ThrowRightward;
     localEventManager.SpecialLeftwardEvent  += SpecialLeftward;
     localEventManager.SpecialRightwardEvent += SpecialRightward;
 }
コード例 #11
0
ファイル: TeamManager.cs プロジェクト: jishclurk/CapstoneGame
    public void LoadSavedState(SerializedPlayer[] state)
    {
        for (int i = 0; i < playerList.Count; i++)
        {
            SerializedPlayer    playerState   = state[i];
            Player              currentPlayer = getPlayerFromId(playerState.id);
            CharacterAttributes current       = currentPlayer.attributes;
            current.Level        = playerState.level;
            current.Experience   = playerState.experience;
            current.StatPoints   = playerState.statPoints;
            current.Strength     = playerState.strength;
            current.Intelligence = playerState.intelligence;
            current.Stamina      = playerState.stamina;
            currentPlayer.abilities.UpdateUnlockedAbilities(current);
            currentPlayer.resources.currentHealth = playerState.health;
            currentPlayer.resources.currentEnergy = playerState.energy;

            for (int j = 0; j < playerState.abilities.Length; j++)
            {
                currentPlayer.abilities.SetNewAbility(playerState.abilities[j], j);
            }
            currentPlayer.abilities.SetBasic(playerState.basic);

            if (playerState.isInControl)
            {
                activePlayer = currentPlayer;
                currentPlayer.strategy.isplayerControlled = true;
                playerResources = activePlayer.GetComponent <PlayerResources>();
                // cameraScript = Camera.main.GetComponent<OffsetCamera>();
                cameraScript.activePlayerCharacter = activePlayer.gameObject;
            }
        }
    }
コード例 #12
0
	public CharacterBase(GameObject This)
	{
		characterObj = This;
		UpBody = This.transform.Find("UpBody").gameObject;
		DownCollider = This.transform.Find("DownCollider").gameObject;
		UpperAnim = This.transform.Find("UpBody/Upper").GetComponent<Animation>();
		FeetAnim = This.transform.Find("UpBody/Upper/Feet").GetComponent<Animation>();
		HeadSprite = This.transform.Find("UpBody/Upper/Head").GetComponent<SpriteRenderer>();
		BodySprite = This.transform.Find("UpBody/Upper/Body").GetComponent<SpriteRenderer>();
		characterAttributes = This.GetComponent<CharacterAttributes>();
		localEventManager = This.GetComponent<CharacterManager>().localEventManager;
		equipmentStatus = new EquipmentStatus("EmptyHand","Small"){Range=new Vector2(1,1)};
		characterStatus = new InAir(this,"Normal");
		characterStatus.Enter();
		EventManager.eventManager.DamageCheckEvent+=DamageCheck;
		localEventManager.ChangeToAirEvent+=ChangeToAir;
		localEventManager.ChangeToGroundEvent+=ChangeToGround;
		localEventManager.JumpEvent += Jump;
		localEventManager.MoveEvent += Move;
		localEventManager.AttackEvent += Attack;
		localEventManager.JumpLeftwardEvent += JumpLeftward;
		localEventManager.JumpRightwardEvent += JumpRightward;
		localEventManager.DodgeLeftwardEvent += DodgeLeftward;
		localEventManager.DodgeRightwardEvent += DodgeRightward;
		localEventManager.ThrowLeftwardEvent += ThrowLeftward;
		localEventManager.ThrowRightwardEvent += ThrowRightward;
		localEventManager.SpecialLeftwardEvent += SpecialLeftward;
		localEventManager.SpecialRightwardEvent += SpecialRightward;
	}
コード例 #13
0
    // SHIELD BOOSTER //
    public void ShieldBoosterRoutine(CharacterAttributes attributes, GameObject target, float length, Object booster)
    {
        AOETargetController aoeController = target.GetComponent <AOETargetController>();

        GameObject[] affectedPlayersCopy = new GameObject[aoeController.affectedPlayers.Count];
        aoeController.affectedPlayers.CopyTo(affectedPlayersCopy);
        StartCoroutine(ShieldBoosterEffect(affectedPlayersCopy, length, booster));
        Destroy(target);
    }
コード例 #14
0
        public void MinusTest()
        {
            var testdata = new CharacterAttributes {
                AttackPoints = 5, DefendPoints = 3
            };

            (-testdata).AttackPoints.Should().Be(-5);
            (-testdata).DefendPoints.Should().Be(-3);
        }
コード例 #15
0
        public HeroAdminAttributeItemVM(CharacterAttributesEnum attributesEnum, int value, Action <CharacterAttributesEnum, int> onAttributeChange)
        {
            this._attributesEnum    = attributesEnum;
            this._attributeValue    = value;
            this._onAttributeChange = onAttributeChange;
            CharacterAttribute characterAttribute = CharacterAttributes.GetCharacterAttribute(attributesEnum);

            this._nameText = characterAttribute.Abbreviation.ToString();
        }
コード例 #16
0
 // Konstruktor som tilskriver intans variablene samt køre methoden RunInvList
 public AddToInventoryForm(List <Item> MyList, CharacterAttributes Attri, EquippedItems EQ)
 {
     myInventoryList = MyList;
     myAttributes    = Attri;
     myEquippedItems = EQ;
     InitializeComponent();
     this.BackColor = ColorTranslator.FromHtml("#D2D6D7");
     RunInvList();
 }
コード例 #17
0
 //increases an attribute att by str
 public void ChangeAttribute(CharacterAttributes att, int str)
 {
     attributes[(int)att] += str;
     //Debug.Log(charName + " " + (attributes[(int)att] - str) + " -> " + attributes[(int)att]);
     if (attributes[(int)CharacterAttributes.Health] <= 0)
     {
         Debug.Log(charName + " has been slain");
     }
 }
コード例 #18
0
    private void SetCharacter(CharacterAttributes character)
    {
        characterArt.sprite = character.menuArt;

        characterName.text    = character.menuName;
        characterSpeed.text   = "Speed: " + character.speedUI + "/5";
        characterWealth.text  = "Wealth: " + character.moneyUI + "/5";
        characterSpecial.text = "Special: " + character.specialUI;
    }
コード例 #19
0
 void Awake()
 {
     tm             = GameObject.FindWithTag("TeamManager").GetComponent <TeamManager>();
     animController = GetComponent <PlayerAnimationController>();
     currentHealth  = maxHealth;
     currentEnergy  = maxEnergy;
     InvokeRepeating("RegenerateEnergy", 1.0f, energyRegenRateInSeconds);
     attributes   = GetComponent <CharacterAttributes>();
     deadCollider = transform.FindChild("DeadHitBox").GetComponent <BoxCollider>();
 }
コード例 #20
0
    public void SetCharacter(GameObject obj)
    {
        CharacterController cc = obj.GetComponent <CharacterController>();

        cc_slopeLimit      = cc.slopeLimit;
        cc_stepOffset      = cc.stepOffset;
        cc_skinWidth       = cc.skinWidth;
        cc_minMoveDistance = cc.minMoveDistance;
        cc_center          = cc.center;
        cc_radius          = cc.radius;
        cc_height          = cc.height;

        Player_Movement player = obj.GetComponent <Player_Movement>();

        p_smooth = player.smooth;
        //p_isDead = player.isDead;
        p_onGravityField = player.onGravityField;
        //p_isSwap = player.isSwap;
        p_rollDistance    = player.rollDistance;
        p_rollReduction   = player.rollReduction;
        p_jumpPower       = player.JumpPower;
        p_swapDelay       = player.SwapDelay;
        p_walkSpeed       = player.walkSpeed;
        p_jogSpeed        = player.jogSpeed;
        p_runSpeed        = player.runSpeed;
        p_meleeDistance   = player.MeleeDistance;
        p_rotateTurnSpeed = player.RotateturnSpeed;

        Player_IK handIK = obj.GetComponent <Player_IK>();

        ik_smoothDamp = handIK.smoothDamp;

        CharacterAttributes attribute = obj.GetComponent <CharacterAttributes>();

        c_name                  = attribute.name;
        c_maxHealth             = attribute.maxHealth;
        c_health                = attribute.health;
        c_maxShield             = attribute.maxShield;
        c_shield                = attribute.shield;
        c_shieldRecoverValue    = attribute.shieldRecoverValue;
        c_shieldRecoverStart    = attribute.shieldRecoverStartTime;
        c_shieldRecoverInterval = attribute.shieldRecoverIntervalTime;
        c_faceSprite            = attribute.faceSprite.name;

        WeaponManager weapon = obj.GetComponent <WeaponManager>();

        w_mainWeapon    = weapon.m_MainWeapon;
        w_subWeapon     = weapon.m_SubWeapon;
        w_specialWeapon = new string[weapon.m_SpecialWeapon.Count];

        for (int i = 0; i < weapon.m_SpecialWeapon.Count; i++)
        {
            w_specialWeapon[i] = weapon.m_SpecialWeapon[i];
        }
    }
コード例 #21
0
 public Character(CharacterMovement characterMovement, CharacterHighlight characterHighlight, GameObject characterActor, CharacterAttributes characterAttributes, CharacterEnum type, int team)
 {
     CharacterActor               = characterActor;
     CharacterHighlight           = characterHighlight;
     CharacterMovement            = characterMovement;
     CharacterAttributes          = characterAttributes;
     CharacterMovement.IsSelected = () => CharacterHighlight.State == CharacterHighlightEnum.Selected;
     CharacterMovement.attributes = CharacterAttributes;
     Type = type;
     Team = team;
 }
コード例 #22
0
ファイル: CharacterInfoData.cs プロジェクト: shnkrR/POG
        public CharacterInfo()
        {
            _Meta             = new CharacterMeta();
            _Meta._PrefabName = "Prefab Name";
            _Meta._SoulScore  = 0;

            _Attributes            = new CharacterAttributes();
            _Attributes._Speed     = 0.5f;
            _Attributes._Work      = 0.5f;
            _Attributes._Health    = 0.5f;
            _Attributes._Fertility = 0.5f;
        }
コード例 #23
0
 //Constructor with inputs, att for attribute and value for strength
 public ImmediateEffect(string name, CharacterAttributes att, int basePower, CharacterAttributes powBonus, float powBonusMultiplier = 0.5f, bool isDmg = true, bool affectedByArmor = true, int num = 1, int sides = 10)
 {
     this.name            = name;
     attribute            = att;
     power                = basePower;
     powerBonus           = powBonus;
     powerBonusMultiplier = powBonusMultiplier;
     numDice              = num;
     diceSides            = sides;
     isDamage             = isDmg;
     isAffectedByArmor    = affectedByArmor;
 }
コード例 #24
0
 public void UpdateUnlockedAbilities(CharacterAttributes attributes)
 {
     for (int i = potentialAbilities.Count - 1; i >= 0; i--)
     {
         IAbility potential = potentialAbilities[i];
         if (attributes.Strength >= potential.StrengthRequired && attributes.Stamina >= potential.StaminaRequired && attributes.Intelligence >= potential.IntelligenceRequired)
         {
             potentialAbilities.Remove(potential);
             unlockedAbilities.Add(potential);
         }
     }
 }
        static void Postfix(SkillVM __instance, ref int ____fullLearningRateLevel, CharacterVM ____developerVM)
        {
            int attr = ____developerVM.GetCurrentAttributePoint(__instance.Skill.CharacterAttributesEnum);

            ____fullLearningRateLevel = (int)(__instance.Level + __instance.CurrentFocusLevel * Reworked_SkillsSubModule.__FOCUS_VALUE + attr * Reworked_SkillsSubModule.__ATTR_VALUE);
            TextObject attrname = CharacterAttributes.GetCharacterAttribute(__instance.Skill.CharacterAttributeEnum).Name;

            __instance.LearningRateTooltip  = new BasicTooltipViewModel(() => GetLearningRateTooltip(attr, __instance.CurrentFocusLevel, __instance.Level, ____developerVM.Hero.CharacterObject.Level, attrname));
            __instance.LearningLimitTooltip = new BasicTooltipViewModel(() => {
                Patch4.SKILLLEVEL = __instance.Level;
                return(GetLearningLimitTooltip(attr, __instance.CurrentFocusLevel, attrname));
            });
        }
コード例 #26
0
 //Constructor for a Single Effect Ability
 public Ability(string name, ImmediateEffect eff, CharacterAttributes atk, CharacterAttributes tar, int range, int num = 2, int sides = 10, int baseDif = 11, bool lineOfSight = true, bool affectedByCover = true)
 {
     this.name = name;
     effects.Add(eff);
     attackAttribute      = atk;
     targetAttribute      = tar;
     numDice              = num;
     diceSides            = sides;
     baseDifficulty       = baseDif;
     this.range           = range;
     requiresLineOfSight  = lineOfSight;
     this.affectedByCover = affectedByCover;
 }
コード例 #27
0
    // BIO GRENADE //

    public void BioGrenadeRoutine(CharacterAttributes attributes, GameObject origin, GameObject target, float baseHeal, float healRate, float healLength, float timeToCast, Object bubble)
    {
        Vector3          bubbleOrigin = new Vector3(target.transform.position.x, target.transform.position.y, target.transform.position.z);
        GameObject       shield       = Instantiate(bubble, bubbleOrigin, Quaternion.identity) as GameObject;
        HealBubbleScript hb           = shield.GetComponent <HealBubbleScript>();

        hb.healHP     = baseHeal;
        hb.healRate   = healRate;
        hb.healLength = healLength;
        hb.target     = target;
        Destroy(shield, healLength);
        Destroy(target, healLength);
    }
コード例 #28
0
    // GRENADE THROW //

    public void GrenadeThrowRoutine(CharacterAttributes attributes, GameObject origin, GameObject target, float damage, Object explosion, float timeToCast, Object grenade)
    {
        Vector3    nadeOrigin = new Vector3(origin.transform.position.x, origin.transform.position.y + 0.8f, origin.transform.position.z + 0.1f);
        GameObject nade       = Instantiate(grenade, nadeOrigin, Quaternion.identity) as GameObject;

        nade.transform.LookAt(target.transform);
        nade.GetComponent <Rigidbody>().velocity        = new Vector3(0.0f, 4.9f, 0.0f);
        nade.GetComponent <Rigidbody>().angularVelocity = new Vector3(8.0f, 2.0f, 7.0f);
        StartCoroutine(MoveObject(nade.transform, target.transform, 0.95f));
        Destroy(nade, 1.0f);

        StartCoroutine(Explode(attributes, origin, target, damage, explosion, timeToCast));
    }
コード例 #29
0
    // Use this for initialization
    void Awake()
    {
        attributes = GetComponent <CharacterAttributes>();
        abilities  = GetComponent <PlayerAbilities>();
        resources  = GetComponent <PlayerResources>();
        strategy   = GetComponent <Strategy>();

        animController = GetComponent <PlayerAnimationController>();

        watchedEnemies = new HashSet <GameObject>();
        visibleEnemies = new HashSet <GameObject>();
        gunbarrel      = transform.FindDeepChild("ShootFX");
    }
コード例 #30
0
    private void DoSpeech()
    {
        attributes = speechData[index].source.GetComponent <CharacterAttributes>();

        Vector2 sourcePosition         = attributes.getCharacterPosition();
        Vector2 bubblePosition         = new Vector2(sourcePosition.x, sourcePosition.y + attributes.getBubbleSpeechHeight());
        Vector2 bubblePositionToScreen = Camera.main.WorldToScreenPoint(bubblePosition);

        SpeechBox.instance.ChangeText(speechData[index].text, bubblePosition);

        SetDirection(facingDirection.Null);

        index++;
    }
コード例 #31
0
        public void FillHeroData(HeroAdminCharacter hero)
        {
            this._hero             = hero;
            this.CurrentFocusLevel = hero.GetFocusValue(this.Skill);
            int        boundAttributeCurrentValue = hero.GetAttributeValue(this.Skill.CharacterAttributeEnum);
            TextObject boundAttributeName         = CharacterAttributes.GetCharacterAttribute(this.Skill.CharacterAttributeEnum).Name;
            float      num = Campaign.Current.Models.CharacterDevelopmentModel.CalculateLearningRate(boundAttributeCurrentValue, this.CurrentFocusLevel, this.Level, this._hero.Level, boundAttributeName, false).ResultNumber;

            this.LearningRate          = num;
            this.CanLearnSkill         = (num > 0f);
            this.FullLearningRateLevel = MBMath.Round(Campaign.Current.Models.CharacterDevelopmentModel.CalculateLearningLimit(boundAttributeCurrentValue, this.CurrentFocusLevel, boundAttributeName, false).ResultNumber);
            this.Level = hero.GetSkillValue(this._skillObject);
            RefreshPerks();
        }
コード例 #32
0
	// Use this for initialization
	void Awake()
	{
		localEventManager = new LocalEventManager();
		physicsManager = transform.Find("DownCollider").GetComponent<PhysicsManager>();
		physicsManager.character = gameObject;
		characterAttributes = GetComponent<CharacterAttributes>();
		inputManager = GetComponent<InputManager>();
		inputManager.localEventManager = localEventManager;
		if(Type!=CharacterType.Player)
		{
			transform.Find("UpBody").GetComponent<AudioListener>().enabled = false;
			inputManager.enabled=false;
		}
		switch (Type) {
		case CharacterType.Player:
			character=new Player(gameObject);
			GameManager.Player=transform.Find("DownCollider").gameObject;
			break;
		case CharacterType.Enemy:
			character=new Enemy(gameObject);
			break;
		}
	}
コード例 #33
0
 public int GetAttributeModifier(CharacterAttributes _attribute)
 {
     return (GetAttribute(_attribute) - 10) / 2;
 }
コード例 #34
0
ファイル: WinConsole.cs プロジェクト: JinJoyce/winapinet
        /// <summary>
        /// Copies a number of character attributes to consecutive cells of a console screen buffer, beginning at a
        /// specified location.
        /// </summary>
        /// <param name="hConsoleOutput">
        /// [in] A handle to the console screen buffer. The handle must have the <see cref="ConsoleAccess.GENERIC_WRITE"/>
        /// access right.
        /// </param>
        /// <param name="lpAttribute">
        /// [in] The attributes to be used when writing to the console screen buffer.
        /// </param>
        /// <param name="nLength">
        /// [in] The number of screen buffer character cells to which the attributes will be copied.
        /// </param>
        /// <param name="dwWriteCoord">
        /// [in] A <see cref="Coord"/> structure that specifies the character coordinates of the first cell in the
        /// console screen buffer to which the attributes will be written.
        /// </param>
        /// <returns>The number of attributes actually written to the console screen buffer.</returns>
        public static uint WriteConsoleOutputAttribute(
            SafeConsoleHandle hConsoleOutput,
            CharacterAttributes[] lpAttribute,
            uint nLength,
            Coord dwWriteCoord)
        {
            uint lpNumberOfAttrsWritten;
            WinError.ThrowLastWin32ErrorIfFailed(
                WriteConsoleOutputAttribute(hConsoleOutput, lpAttribute, nLength, dwWriteCoord, out lpNumberOfAttrsWritten));

            return lpNumberOfAttrsWritten;
        }
コード例 #35
0
ファイル: WinConsole.cs プロジェクト: JinJoyce/winapinet
 public static extern bool WriteConsoleOutputAttribute(
     SafeConsoleHandle hConsoleOutput,
     CharacterAttributes[] lpAttribute,
     uint nLength,
     Coord dwWriteCoord,
     out uint lpNumberOfAttrsWritten);
コード例 #36
0
ファイル: WinConsole.cs プロジェクト: JinJoyce/winapinet
 public static extern bool SetConsoleTextAttribute(
     SafeConsoleHandle hConsoleOutput,
     CharacterAttributes wAttributes);
コード例 #37
0
 public void AddingTest(CharacterAttributes c1, CharacterAttributes c2, int expectedAttacPoints, int expectedDefensePoints)
 {
     (c1 + c2).AttackPoints.Should().Be(expectedAttacPoints);
     (c1 + c2).DefendPoints.Should().Be(expectedDefensePoints);
 }
コード例 #38
0
 public void AddingNullTest(CharacterAttributes c1, CharacterAttributes c2)
 {
      Action adding = () => {var e = c1 + c2; };
     adding.ShouldThrow<NullReferenceException>();
 }
コード例 #39
0
 public void MinusTest()
 {
     var testdata = new CharacterAttributes { AttackPoints = 5, DefendPoints = 3 };
     (-testdata).AttackPoints.Should().Be(-5);
     (-testdata).DefendPoints.Should().Be(-3);
 }
コード例 #40
0
 public static string SetCharacterAttribute(CharacterAttributes attributes)
 {
     var pa = (byte)(attributes | CharacterAttributes.NoOp);
     return Encoding.ASCII.GetString(new byte[] { Ascii.ESC, Ascii.Four, pa });
 }
コード例 #41
0
ファイル: ConsoleOutputDevice.cs プロジェクト: deveel/dshell
 private static extern bool SetConsoleTextAttribute(IntPtr hConsoleOutput, CharacterAttributes wAttributes);
コード例 #42
0
        public int GetAttribute(CharacterAttributes _attribute)
        {
            switch (_attribute)
            {
                case CharacterAttributes.VIGOR:
                    return Vigor;

                case CharacterAttributes.STRENGHT:
                    return Strenght;

                case CharacterAttributes.DEXTERITY:
                    return Dexterity;

                case CharacterAttributes.PSYCHOLOGY:
                    return Psychology;

                case CharacterAttributes.MAGICAL_GIFT:
                    return MagicalGift;

                default:
                    return 0;
            }
        }
コード例 #43
0
ファイル: StaticItem.cs プロジェクト: kales5/rpg_googolplex
 public StaticItem()
 {
     AttributesEffekts = new CharacterAttributes();
     FluentAttributesEffekts = new CharacterFluentAttributes();
 }