示例#1
0
        public static AIHeroClient GetTarget(Orbwalker.ActiveModes?Mode = null, DamageType?type = null)
        {
            switch (Mode)
            {
            default:
                return(GetTargetByType(1000, null));

            case Orbwalker.ActiveModes.Combo:
                return(GetTargetByType(1200, type));

            case Orbwalker.ActiveModes.Flee:
                return(GetTargetByType(650, type));

            case Orbwalker.ActiveModes.Harass:
                return(GetTargetByType(900, type));

            case Orbwalker.ActiveModes.JungleClear:
                return(GetTargetByType(750, type));

            case Orbwalker.ActiveModes.LaneClear:
                return(GetTargetByType(750, type));

            case Orbwalker.ActiveModes.LastHit:
                return(GetTargetByType(700, type));
            }
        }
示例#2
0
 private static AIHeroClient GetTargetByType(float range, DamageType?type)
 {
     if (type == null)
     {
         return(target(range, DamageType.Mixed));
     }
     return(target(range, type));
 }
示例#3
0
    public void Display(float amount, double tick, DamageType?type, Entity entity)
    {
        transform.position = entity.transform.position;

        CurrentType = (type ?? (amount > 0 ? DamageType.DAMAGE : DamageType.MISS));
        if (entity.Type == EntityType.PC)
        {
            CurrentType |= DamageType.ENEMY;
        }

        var color = new Color();

        color[3] = 1.0f;
        Delay    = 1500;
        start    = tick;

        if ((CurrentType & DamageType.SP) > 0)
        {
            color[0] = 0.13f;
            color[1] = 0.19f;
            color[2] = 0.75f;
        }
        else if ((CurrentType & DamageType.HEAL) > 0)
        {
            color[1] = 1.0f;
        }
        else if ((CurrentType & DamageType.ENEMY) > 0)
        {
            color[2] = 1.0f;
        }
        else if ((CurrentType & DamageType.COMBO) > 0)
        {
            color[0] = 0.9f;
            color[1] = 0.9f;
            color[2] = 0.15f;
            Delay    = 3000;
        }
        else
        {
            color[0] = 1.0f;
            color[1] = 1.0f;
            color[2] = 1.0f;
        }

        textMesh.color = color;
        Ready          = true;
        Destroy(gameObject, Delay / 1000);

        // miss
        if (amount == 0)
        {
            textMesh.text = "MISS";
        }
        else
        {
            textMesh.text = $"{amount}";
        }
    }
示例#4
0
        private async void OnItemSelected(DamageType?item)
        {
            if (item == null)
            {
                return;
            }

            await Shell.Current.GoToAsync($"{nameof(EditDamageTypePage)}?{nameof(EditDamageTypeViewModel.ItemId)}={item.Id}");
        }
示例#5
0
 public Trap(string name, Save save, int spot, int disable, DisableCheck disableCheck, bool attackMod, DamageType?dmgType, string special)
 {
     Name         = name;
     Save         = save;
     Spot         = spot;
     Disable      = disable;
     DisableCheck = disableCheck;
     AttackMod    = attackMod;
     DmgType      = dmgType;
     Special      = special;
 }
示例#6
0
 public InvulnerableStruct(string champion,
                           string buffName,
                           DamageType?damageType,
                           bool isShield,
                           Func <Obj_AI_Base, DamageType, bool> customCheck = null) : this()
 {
     Champion    = champion;
     BuffName    = buffName;
     DamageType  = damageType;
     IsShield    = isShield;
     CustomCheck = customCheck;
 }
示例#7
0
 public Item(string champion,
             string buffName,
             DamageType?damageType,
             bool isShield,
             Func <Obj_AI_Base, DamageType, bool> customCheck = null)
 {
     Champion    = champion;
     BuffName    = buffName;
     DamageType  = damageType;
     IsShield    = isShield;
     CustomCheck = customCheck;
 }
示例#8
0
    /**
     * This method renders the damage sprites
     * The packet to receive damage data and etc is ZC_PAR_CHANGE
     */
    public void Damage(float amount, double tick, DamageType?damageType = null)
    {
        var DamagePrefab = (GameObject)Resources.Load("Prefabs/Damage");

        if (!DamagePrefab)
        {
            throw new Exception("Could not load damage prefab");
        }

        var damageRenderer = Instantiate(DamagePrefab).GetComponent <DamageRenderer>();

        damageRenderer.Display(amount, tick, damageType, this);
    }
示例#9
0
 public Move(string name, PokemonType type, int?power, DamageType?damageType, int accuracy, MoveTarget target, int basePP, int maxPossiblePP, int priority, int criticalHitStage)
 {
     Name             = name;
     Type             = type;
     Power            = power;
     DamageType       = damageType;
     Accuracy         = accuracy;
     Target           = target;
     BasePP           = basePP;
     MaxPPLimit       = maxPossiblePP;
     Priority         = priority;
     CriticalHitStage = criticalHitStage;
 }
示例#10
0
 public Item(string champion,
             string buffName,
             DamageType?damageType,
             bool isShield,
             int minHealthPercent = -1,
             Func <Obj_AI_Base, DamageType, bool> checkFunction = null)
 {
     Champion         = champion;
     BuffName         = buffName;
     DamageType       = damageType;
     IsShield         = isShield;
     MinHealthPercent = minHealthPercent;
     CheckFunction    = checkFunction;
 }
示例#11
0
        public override void ApplyState(Gum.DataTypes.Variables.StateSave state)
        {
            bool matches = this.ElementSave.AllStates.Contains(state);

            if (matches)
            {
                var category = this.ElementSave.Categories.FirstOrDefault(item => item.States.Contains(state));
                if (category == null)
                {
                    if (state.Name == "Default")
                    {
                        this.mCurrentVariableState = VariableState.Default;
                    }
                }
                else if (category.Name == "DamageType")
                {
                    if (state.Name == "Piercing")
                    {
                        this.mCurrentDamageTypeState = DamageType.Piercing;
                    }
                    if (state.Name == "Bombarding")
                    {
                        this.mCurrentDamageTypeState = DamageType.Bombarding;
                    }
                    if (state.Name == "Chemical")
                    {
                        this.mCurrentDamageTypeState = DamageType.Chemical;
                    }
                    if (state.Name == "Frost")
                    {
                        this.mCurrentDamageTypeState = DamageType.Frost;
                    }
                    if (state.Name == "Fire")
                    {
                        this.mCurrentDamageTypeState = DamageType.Fire;
                    }
                    if (state.Name == "Electric")
                    {
                        this.mCurrentDamageTypeState = DamageType.Electric;
                    }
                }
            }
            base.ApplyState(state);
        }
示例#12
0
 public FlatRedBall.Glue.StateInterpolation.Tweener InterpolateToRelative(DamageType toState, double secondsToTake, FlatRedBall.Glue.StateInterpolation.InterpolationType interpolationType, FlatRedBall.Glue.StateInterpolation.Easing easing, object owner = null)
 {
     Gum.DataTypes.Variables.StateSave           current       = GetCurrentValuesOnState(toState);
     Gum.DataTypes.Variables.StateSave           toAsStateSave = AddToCurrentValuesWithState(toState);
     FlatRedBall.Glue.StateInterpolation.Tweener tweener       = new FlatRedBall.Glue.StateInterpolation.Tweener(from: 0, to: 1, duration: (float)secondsToTake, type: interpolationType, easing: easing);
     if (owner == null)
     {
         tweener.Owner = this;
     }
     else
     {
         tweener.Owner = owner;
     }
     tweener.PositionChanged = newPosition => this.InterpolateBetween(current, toAsStateSave, newPosition);
     tweener.Ended          += () => this.CurrentDamageTypeState = toState;
     tweener.Start();
     StateInterpolationPlugin.TweenerManager.Self.Add(tweener);
     return(tweener);
 }
示例#13
0
        public void TestSurpriseAttackBasic()
        {
            SetupGameController("BaronBlade", DeckNamespace, "Ra", "TheVisionary", "Megalopolis");
            StartGame();
            DestroyCard(MDP);

            PlayCard("SurpriseAttack");

            QuickHPStorage(baron, visionary);
            UsePower(ra);
            QuickHPCheck(-3, 0);

            DecisionSelectDamageTypes = new DamageType?[] { DamageType.Psychic, DamageType.Fire };

            PlayCard("ElementalRedistributor");

            //when picking psychic, shouldn't get redirected
            UsePower(ra);
            QuickHPCheck(-3, 0);

            //now that we are picking fire, should redirect the damage to Visionary
            UsePower(ra);
            QuickHPCheck(0, -3);
        }
示例#14
0
 /// <summary>
 /// DamageModifier constructor
 /// </summary>
 /// <param name="damageType">The DamageType</param>
 /// <param name="value">The value for the DamageType</param>
 public DamageModifier(DamageType?damageType, float value)
 {
     DamageType = damageType;
     Value      = value;
 }
示例#15
0
        protected IEnumerator SelectActiveCharacterCardToDealDamage(List <Card> storedResults, int?damageAmount = null, DamageType?damageType = null)
        {
            //future-proofing for Nightlore Council
            if (IsMultiCharPromo())
            {
                List <SelectCardDecision> storedDecision = new List <SelectCardDecision>();

                IEnumerator coroutine;
                if (damageAmount == null || damageType == null)
                {
                    coroutine = base.GameController.SelectCardAndStoreResults(this.HeroTurnTakerController, SelectionType.HeroCharacterCard, new LinqCardCriteria((Card c) => c.Owner == base.TurnTaker && c.IsCharacter && !c.IsIncapacitatedOrOutOfGame, "active Starlight"), storedDecision, optional: false, allowAutoDecide: false, includeRealCardsOnly: true, cardSource: GetCardSource());
                }
                else
                {
                    DealDamageAction previewDamage = new DealDamageAction(GetCardSource(), null, null, (int)damageAmount, (DamageType)damageType);
                    coroutine = base.GameController.SelectCardAndStoreResults(this.HeroTurnTakerController, SelectionType.HeroToDealDamage, new LinqCardCriteria((Card c) => c.Owner == base.TurnTaker && c.IsCharacter && !c.IsIncapacitatedOrOutOfGame, "active Starlight"), storedDecision, optional: false, allowAutoDecide: false, previewDamage, includeRealCardsOnly: true, GetCardSource());
                }

                if (base.UseUnityCoroutines)
                {
                    yield return(base.GameController.StartCoroutine(coroutine));
                }
                else
                {
                    base.GameController.ExhaustCoroutine(coroutine);
                }
                SelectCardDecision selectCardDecision = storedDecision.FirstOrDefault();
                if (selectCardDecision != null)
                {
                    storedResults.Add(selectCardDecision.SelectedCard);
                }
            }
            else
            {
                storedResults.Add(TurnTaker.CharacterCard);
            }
            yield break;
        }
示例#16
0
        public void InterpolateBetween(DamageType firstState, DamageType secondState, float interpolationValue)
        {
                #if DEBUG
            if (float.IsNaN(interpolationValue))
            {
                throw new System.Exception("interpolationValue cannot be NaN");
            }
                #endif
            bool setSpriteInstanceTextureTopFirstValue  = false;
            bool setSpriteInstanceTextureTopSecondValue = false;
            int  SpriteInstanceTextureTopFirstValue     = 0;
            int  SpriteInstanceTextureTopSecondValue    = 0;
            switch (firstState)
            {
            case  DamageType.Piercing:
                setSpriteInstanceTextureTopFirstValue = true;
                SpriteInstanceTextureTopFirstValue    = 365;
                break;

            case  DamageType.Bombarding:
                setSpriteInstanceTextureTopFirstValue = true;
                SpriteInstanceTextureTopFirstValue    = 292;
                break;

            case  DamageType.Chemical:
                setSpriteInstanceTextureTopFirstValue = true;
                SpriteInstanceTextureTopFirstValue    = 73;
                break;

            case  DamageType.Frost:
                setSpriteInstanceTextureTopFirstValue = true;
                SpriteInstanceTextureTopFirstValue    = 219;
                break;

            case  DamageType.Fire:
                setSpriteInstanceTextureTopFirstValue = true;
                SpriteInstanceTextureTopFirstValue    = 146;
                break;

            case  DamageType.Electric:
                setSpriteInstanceTextureTopFirstValue = true;
                SpriteInstanceTextureTopFirstValue    = 0;
                break;
            }
            switch (secondState)
            {
            case  DamageType.Piercing:
                setSpriteInstanceTextureTopSecondValue = true;
                SpriteInstanceTextureTopSecondValue    = 365;
                break;

            case  DamageType.Bombarding:
                setSpriteInstanceTextureTopSecondValue = true;
                SpriteInstanceTextureTopSecondValue    = 292;
                break;

            case  DamageType.Chemical:
                setSpriteInstanceTextureTopSecondValue = true;
                SpriteInstanceTextureTopSecondValue    = 73;
                break;

            case  DamageType.Frost:
                setSpriteInstanceTextureTopSecondValue = true;
                SpriteInstanceTextureTopSecondValue    = 219;
                break;

            case  DamageType.Fire:
                setSpriteInstanceTextureTopSecondValue = true;
                SpriteInstanceTextureTopSecondValue    = 146;
                break;

            case  DamageType.Electric:
                setSpriteInstanceTextureTopSecondValue = true;
                SpriteInstanceTextureTopSecondValue    = 0;
                break;
            }
            if (setSpriteInstanceTextureTopFirstValue && setSpriteInstanceTextureTopSecondValue)
            {
                SpriteInstance.TextureTop = FlatRedBall.Math.MathFunctions.RoundToInt(SpriteInstanceTextureTopFirstValue * (1 - interpolationValue) + SpriteInstanceTextureTopSecondValue * interpolationValue);
            }
            if (interpolationValue < 1)
            {
                mCurrentDamageTypeState = firstState;
            }
            else
            {
                mCurrentDamageTypeState = secondState;
            }
        }
示例#17
0
        private static AIHeroClient target(float range, DamageType?type)
        {
            var damagetype = type ?? default(DamageType);

            return(TargetSelector.GetTarget(range, damagetype));
        }
示例#18
0
        public override IEnumerator UsePower(int index = 0)
        {
            //Destroy a season.
            IEnumerator coroutine = base.GameController.SelectAndDestroyCard(base.HeroTurnTakerController, new LinqCardCriteria((Card c) => IsSeason(c), "season"), false, cardSource: GetCardSource());

            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            //Play a season...
            List <PlayCardAction> storedResults = new List <PlayCardAction>();

            coroutine = base.GameController.SelectAndPlayCardFromHand(base.HeroTurnTakerController, false, storedResults: storedResults, cardCriteria: new LinqCardCriteria((Card c) => IsSeason(c), "season"), cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }

            // ...and change the next damage dealt by {LadyOfTheWood} to a type listed on it.
            if (DidPlayCards(storedResults))
            {
                Card       season = storedResults.First().CardToPlay;
                DamageType?dt     = GetDamageTypeFromSeason(season);
                if (dt != null)
                {
                    DamageType damageType = dt.Value;
                    ChangeDamageTypeStatusEffect effect = new ChangeDamageTypeStatusEffect(damageType);
                    effect.NumberOfUses = 1;
                    effect.SourceCriteria.IsSpecificCard = base.Card;
                    coroutine = AddStatusEffect(effect);
                    if (base.UseUnityCoroutines)
                    {
                        yield return(base.GameController.StartCoroutine(coroutine));
                    }
                    else
                    {
                        base.GameController.ExhaustCoroutine(coroutine);
                    }
                }
            }

            // You may use a power
            coroutine = base.GameController.SelectAndUsePower(base.HeroTurnTakerController, cardSource: GetCardSource());
            if (base.UseUnityCoroutines)
            {
                yield return(base.GameController.StartCoroutine(coroutine));
            }
            else
            {
                base.GameController.ExhaustCoroutine(coroutine);
            }
            yield break;
        }
示例#19
0
 public Move(string name, PokemonType type, int?power, DamageType?damageType, int accuracy, MoveTarget target, int basePP, int maxPossiblePP) : this(name, type, power, damageType, accuracy, target, basePP, maxPossiblePP, DefaultPriority, DefaultCriticalHitStage)
 {
 }
示例#20
0
        public Task <SearchItemsResponse> SearchItems(ImpactEffect?impactEffects = null, GuardianAttribute?guardianAttributes = null, LightAbility?lightAbilities = null, DamageType?damageTypes = null, SourceCategory?sourcecat = null, long?sourcehash = null, bool?matchrandomsteps = null, bool?definitions = null, long?categories = null, SortOrder?order = null, WeaponPerformance?weaponPerformance = null, Rarity?rarity = null, int?page = null, string name = null, Count?count = null, bool?orderstathash = null, SortDirection?direction = null, long?step = null)
        {
            var model = new
            {
                impactEffects,
                guardianAttributes,
                lightAbilities,
                damageTypes,
                sourcecat,
                sourcehash,
                matchrandomsteps,
                definitions,
                categories,
                order,
                weaponPerformance,
                rarity,
                page,
                name,
                count,
                orderstathash,
                direction,
                step
            };

            return(Request <SearchItemsResponse>(model));
        }