Example #1
0
    public bool SetStatus(StatusEffect newStatus)
    {
        if (StatusEffect == StatusEffect.Defeated)
        {
            return false;
        }
        switch (newStatus)
        {
            case StatusEffect.None:
                StatusEffect = newStatus;
                return true;

            case StatusEffect.Poison:
                StatusEffect = newStatus;
                return true;

            case StatusEffect.Burn:
                StatusEffect = newStatus;
                return true;

            case StatusEffect.Confusion:
                StatusEffect = newStatus;
                return true;

            case StatusEffect.Defeated:
                StatusEffect = newStatus;
                return true;
            default:
                return true;
        }
    }
 void AddStatusEffect(StatusEffect effect)
 {
     effect.Kart = player;
     effect.Start();
     statusEffects.Add(effect);
     
 }
 public override void Stack(StatusEffect other)
 {
     if (other is KnockDown) {
         KnockDown otherKnockDown = (KnockDown)other;
         turns += otherKnockDown.turns;
     }
 }
 public static PostEffectController CreatePostEffectController(StatusEffect.Type type)
 {
     //TODO: different types?
     var prefab = Resources.Load("PostEffects/PostEffect") as GameObject;
     var go = GameObject.Instantiate(prefab) as GameObject;
     var controller = go.GetComponent<PostEffectController>();
     return controller;
 }
 public CharacterStatusEffectStatModifier(StatusEffect statusEffect)
 {
     this.RemainingTurns = statusEffect.EffectDuration;
     this.Rank = statusEffect.EffectRank;
     this.StatusEffectCategory = statusEffect.StatusEffectCategory;
     this.StatusEffectType = statusEffect.StatusEffectType;
     this.StatModifier = new StatModifier((Const.Stats)statusEffect.AffectedFieldId, statusEffect.EffectMagnitude, statusEffect.ModifierType); 
 }
Example #6
0
 public void ActionNotUsableWhenBlockedByStatusEffect(
     AbilityType abilityType,
     StatusEffect statusEffect)
 {
     battleAbility.Ability.AbilityType = abilityType;
     player.StatusEffects = new StatusEffect[] { statusEffect };
     VerifyActionNotUsable();
 }
Example #7
0
File: Attack.cs Project: MPLLC/GitS
 public Attack(string name, int level, int tpCost, double dmgModifier, double hitPenalty, StatusEffect effect)
 {
     this.name = name;
     this.level = level;
     this.tpCost = tpCost;
     this.dmgModifier = dmgModifier;
     this.hitPenalty = hitPenalty;
     this.effect = effect;
 }
Example #8
0
File: Attack.cs Project: MPLLC/GitS
 public Attack()
 {
     this.name = null;
     this.level = 0;
     this.tpCost = 0;
     this.dmgModifier = 0.0;
     this.hitPenalty = 0.0;
     this.effect = null;
 }
Example #9
0
 public void AddEffect(StatusEffect newStatus)
 {
     newStatus.Countdown = newStatus.Duration;
     ActiveStatuses |= newStatus.Type;
     StatusEffectBlockModifier += newStatus.BlockModifier;
     StatusEffectCooldownModifier += newStatus.CooldownModifier;
     StatusEffectHitModifier += newStatus.HitModifier;
     Effects.Add(newStatus);
 }
Example #10
0
 public Player(Texture2D Texture, Vector2 startPosition, int MaxHealth, int MaxEnergy, float walkSpeed, int inventorySize, Vector2 startVelocity, int ID, int Resistance)
     : base(Texture, MaxHealth, startPosition, walkSpeed, Color.White, startVelocity, new Vector2(Texture.Width / 2, Texture.Height / 2), Resistance, Texture.Height, Texture.Width)
 {
     this.Energy = MaxEnergy;
     this.MaxEnergy = MaxEnergy;
     Inventory = new Item[inventorySize];
     Weight = 5;
     exhaustionSlow = new StatusEffect(StatusType.Slowed, 0.5f, -1, "Out of energy!", StatusEffect.ID_EXAUSTION_SLOW);
     exhaustionExhaust = new StatusEffect(StatusType.Exhausted, 0.5f, -1, "Out of energy!", StatusEffect.ID_EXAUSTION_EXHAUST);
     this.LightColour = Color.White;
 }
	// called to apply effect
	public IEnumerator ApplyCondition (StatusEffect _effect)
	{
		entity.condition = _effect; // set the condition
		// sort through which function to use
		switch (_effect)
		{
			case StatusEffect.Confused:
				if (canBeConfused)
				{
					//yield return StartCoroutine("ApplyConfusion");
				}
				break;
			case StatusEffect.Dazed:
				if (canBeDazed)
				{
					yield return StartCoroutine("ApplyDaze");
				}
				break;
			case StatusEffect.EMP:
				if (canBeEMP)
				{
					yield return StartCoroutine("ApplyEMP");
				}
				break;
			case StatusEffect.KnockedBack:
				if (canBeKnockedBack)
				{
					//yield return StartCoroutine("ApplyKnockBack");
				}
				break;
			case StatusEffect.Slowed:
				if (canBeSlowed)
				{
					yield return StartCoroutine("ApplySlow");
				}
				break;
			case StatusEffect.Stuck:
				if (canBeStuck)
				{
					yield return StartCoroutine("ApplyStuck");
				}
				break;
			case StatusEffect.None:
				yield return StartCoroutine("ApplyNone");
				break;
			default:
				yield return StartCoroutine("ApplyNone");
				break;
		}
	}
 public static StatusEffectCreator CreateScriptableObject() {
     StatusEffectCreator asset = ScriptableObject.CreateInstance<StatusEffectCreator>();
     string assetpath = "Assets/Status Effects/Status Effect.asset";
     string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(assetpath);
     var effect = new StatusEffect();
     effect.Id = Path.GetFileNameWithoutExtension(assetPathAndName);
     AssetSerializer serializer = new AssetSerializer();
     serializer.AddItem(effect);
     asset.source = serializer.WriteToString();
     AssetDatabase.CreateAsset(asset, assetPathAndName);
     AssetDatabase.SaveAssets();
     AssetDatabase.Refresh();
     return asset;
 }
	void UpdateStatusEffect () {
		if (currentStatus != playerClass.GetCurrentStatus()) {
			currentStatus = playerClass.GetCurrentStatus();
		}
		
		if (currentStatus == StatusEffect.None) {
			statusText.text = null;
		} else if (currentStatus == StatusEffect.Para) {
			statusText.text = "Para";
			endStatusTime = 3;
		} else if (currentStatus == StatusEffect.Pois) {
			statusText.text = "Pois";
			endStatusTime = 10;
		} 
	}
    public override void Use(Ship ship)
    {
        if (!(Cooldown > 0 || activeEffect))
        {
            activeEffect = CreateInstance<StatusEffect>();
            activeEffect.FlatStats.MaxSpeed = boostAmount;
            activeEffect.FlatStats.Thrust = boostAmount;
            activeEffect.Expires = true;
            activeEffect.Lifetime = boostDuration;

            Cooldown = boostCooldown;

            ship.AddStatusEffect(activeEffect);
        }
    }
Example #15
0
 // --- Static Methods ---
 // Creates a default status effect
 public static StatEffect create(StatusEffect statusEffect, int turnsLeft)
 {
     switch(statusEffect)
     {
         default:
         case StatusEffect.Enraged:
             return new StatEffect(
                 EffectType.Status,
                 "Enraged",
                 "+25% Atk, -20% Def, and lose control of unit",
                 enragedSE,
                 turnsLeft
             );
     }
 }
Example #16
0
 public void AddStatusEffect(StatusEffect se)
 {
     if (se is se_Slow || se is se_Immobilize)
     {
         movementEffects.Add(se);
     }
     if (se is se_Silence || se is se_Disarm)
     {
         attackEffects.Add(se);
     }
     if (se is se_DOT)
     {
         debuffEffects.Add(se);
     }
 }
    public override void Cancel(Ship ship)
    {
        if (activeEffect)
        {
            if (!ship.RemoveStatusEffect(activeEffect))
            {
                Debug.LogWarning("tried to cancel a booster effect but it wasn't affecting the target ship");
            }
        }
        else
        {
            Debug.LogWarning("tried to cancel a booster effect that wasn't active");
        }

        activeEffect = null;
    }
        public StatusHealer(StatusEffect status)
            : base("", 60)
        {
            this.status = status;

            if (status == StatusEffect.burned)
            {
                name = "Burn Heal";
                info = "Heals a burn";
            }
            else if (status == StatusEffect.cursed)
            {
                name = "Holy Water";
                info = "Purifies you from a curse";
            }
        }
	void UpdateStatusEffect () {
		if (currentStatus != enemyMonster.GetCurrentStatus()) {
			currentStatus = enemyMonster.GetCurrentStatus();
		}
		
		if (currentStatus == StatusEffect.None) {
			statusText.text = null;
		} else if (currentStatus == StatusEffect.Para) {
			statusText.text = "Para";
			endStatusTime = 3;
		} else if (currentStatus == StatusEffect.Pois) {
			statusText.text = "Pois";
			endStatusTime = 10;
		} else if (currentStatus == StatusEffect.Slow) {
			statusText.text = "Slow";
			endStatusTime = enemyMonster.GetSecondsBetweenActions();
		} 
	}
	public void ApplyEffect(StatusEffect e, int numStacks)
	{
		for (int i = 0; i < StatusEffects.Count; i++)
		{
			if (StatusEffects[i].EffectType == e.EffectType)
			{
				StatusEffects[i].ApplyStacks(numStacks);
				return;
			}
		}

		Transform t = PoolBoss.SpawnInPool(e.transform, transform.position, transform.rotation);
		StatusEffect newEffect = t.GetComponent<StatusEffect>();
		newEffect.myKillable = m_killable;
		if (numStacks > 1)
		{
			newEffect.ApplyStacks(numStacks - 1);
		}
		StatusEffects.Add(newEffect);
	}
 public void addStatus(StatusEffect effect)
 {
     string name = effect.GetType().Name;
     if (!status.ContainsKey(name))
     {
         StatusEffect instance = effect;
         if (instance != null)
         {
             status.Add(name, instance);
             status[name].addNew();
         }
         else
             Debug.Log("No status effect named " + name);
     }
     else
     {
         if (status[name].overlayCount < status[name].maxOverlay)
             status[name].addNew();
         else
             status[name].reset();
     }
 }
        public virtual void TakeDamage(int damage, WeaponEffect effect)
        {
            if (effect == WeaponEffect.burn)
                status = StatusEffect.burned;
            else if (effect == WeaponEffect.curse)
                status = StatusEffect.cursed;

            if (effect != WeaponEffect.penetrate)
                damage -= defense / 2;

            if (damage < 0)
                damage = 0;

            health -= damage;

            if (status == StatusEffect.burned)
                health -= 5;
            else if (status == StatusEffect.cursed)
                health = (int)Math.Ceiling((4f / 5f) * health);

            if (health <= 0)
                alive = false;
        }
Example #23
0
        private static void UpdateStatusEffect(StatusEffect se, bool onPlayer = false)
        {
            string playerString = onPlayer ? " on local player " : " in ObjectDB ";

            if (se is SE_Stats stats)
            {
                switch (se.m_name)
                {
                case "$se_cold_name":
#if DEBUG
                    UnityEngine.Debug.Log($"[WetAndCold] [{Localization.instance.Localize(se.m_name)}] Updating m_healthRegenMultiplier{playerString}from {stats.m_healthRegenMultiplier} to {coldHealthRegenMultiplier.Value}");
#endif
                    stats.m_healthRegenMultiplier = coldHealthRegenMultiplier.Value;
                    break;

                case "$se_wet_name":
#if DEBUG
                    UnityEngine.Debug.Log($"[WetAndCold] [{Localization.instance.Localize(se.m_name)}] Updating m_healthRegenMultiplier{playerString}from {stats.m_healthRegenMultiplier} to {wetHealthRegenMultiplier.Value}");
#endif
                    stats.m_healthRegenMultiplier = wetHealthRegenMultiplier.Value;
                    break;
                }
            }
        }
Example #24
0
    public void InflictDamageToAllUnits(UnitType unitType, Unit caster, float damage)
    {
        if (caster != null)
        {
            if (caster.statusEffects.Count > 0)
            {
                StatusEffect statusEffect = caster.statusEffects.Find(x => x.type == StatusEffectType.IncreaseAttackSingleUse);
                if (statusEffect != null)
                {
                    IncreaseAttack increaseAttack = (IncreaseAttack)statusEffect;
                    damage = (float)damage * (1f + increaseAttack.magnitude);
                    caster.statusEffects.Remove(statusEffect);
                }
            }
        }

        if (unitType == UnitType.Enemy)
        {
            bool eventSet = false;
            foreach (GameObject enemy in enemies)
            {
                Unit target = (Unit)enemy.GetComponent <Enemy>();

                target.CurrentHealth -= (int)damage;
                var pos   = target.gameObject.transform.position;
                var o     = Instantiate(damageText, pos + new Vector3(0.25f, target.gameObject.GetComponent <SpriteRenderer>().bounds.size.y / 2, 0), Quaternion.identity);
                var dText = o.GetComponent <DamageText>();
                dText.SetText((int)damage);
                if (!eventSet)
                {
                    dText.destroyed.AddListener(CheckUnitStatuses);
                }
                eventSet = true;
            }
        }
    }
Example #25
0
    void AncientChampion()
    {
        int p = Target();

        EnemyColumn();
        for (int x = 1; x <= 25; x++)
        {
            if (PlayerPrefs.GetInt("Tile" + x + "Targeted") == 1)
            {
                for (int e = 1; e <= 8; e++)
                {
                    if (PlayerPrefs.GetInt("E" + e + "-Loc") == x)
                    {
                        Damage(p, e, 6 + 2 * PlayerPrefs.GetInt("P" + p + "-INT"), "Magic");
                        StatusEffect.InflictStatusEnemy("jammed", e, 2);
                    }
                }
            }
        }
        StatusEffect.InflictStatusCharacter("decoy", p, 2);
        SingleTargetSkills.SpecialCharge(p, 2, "Ancient Defender");
        EndSkill(p);
        SkillReset();
    }
        public string CheckRequirements(uint player)
        {
            // DMs are assumed to be able to activate.
            if (GetIsDM(player))
            {
                return(string.Empty);
            }

            if (GetIsPC(player))
            {
                // Manafont reduces MP costs to zero.
                if (StatusEffect.HasStatusEffect(player, StatusEffectType.Manafont))
                {
                    return(string.Empty);
                }

                var playerId = GetObjectUUID(player);
                var dbPlayer = DB.Get <Player>(playerId);

                if (dbPlayer.MP >= _requiredMP)
                {
                    return(string.Empty);
                }

                return($"Not enough MP. (Required: {_requiredMP})");
            }
            else
            {
                var mp = GetLocalInt(player, "MP");
                if (mp >= _requiredMP)
                {
                    return(string.Empty);
                }
                return($"Not enough MP. (Required: {_requiredMP})");
            }
        }
Example #27
0
        private static void ElectricFist2(AbilityBuilder builder)
        {
            builder.Create(Feat.ElectricFist2, PerkType.ElectricFist)
            .Name("Electric Fist II")
            .HasRecastDelay(RecastGroup.ElectricFist, 120f)
            .UsesActivationType(AbilityActivationType.Weapon)
            .RequirementStamina(6)
            .HasImpactAction((activator, target, level) =>
            {
                var modifier = GetAbilityModifier(AbilityType.Wisdom, activator);
                modifier     = modifier > 0 ? modifier : 0;
                var damage   = Random.D8(2) + modifier;
                ApplyEffectToObject(DurationType.Instant, EffectDamage(damage, DamageType.Electrical), target);
                ApplyEffectToObject(DurationType.Instant, EffectVisualEffect(VisualEffect.Vfx_Com_Hit_Electrical), target);

                if (Random.D100(1) <= 50)
                {
                    StatusEffect.Apply(activator, target, StatusEffectType.Static, 18f);
                }

                CombatPoint.AddCombatPoint(activator, target, SkillType.Chi, 3);
                Enmity.ModifyEnmityOnAll(activator, 8 + damage);
            });
        }
        private static void Bleed1(StatusEffectBuilder builder)
        {
            builder.Create(StatusEffectType.Bleed1)
            .Name("Bleed I")
            .EffectIcon(157)
            .GrantAction((target, duration) =>
            {
                if (StatusEffect.HasStatusEffect(target, StatusEffectType.Bleed2) ||
                    StatusEffect.HasStatusEffect(target, StatusEffectType.Bleed3))
                {
                    SendMessageToPC(target, "A more powerful version of Bleed is already in effect.");
                    StatusEffect.Remove(target, StatusEffectType.Bleed1);
                }
            })
            .TickAction((activator, target) =>
            {
                var damage = Random.D4(1);

                AssignCommand(activator, () =>
                {
                    ApplyEffectToObject(DurationType.Instant, EffectDamage(damage, DamageType.Piercing), target);
                });
            });
        }
Example #29
0
    public void InflictStatus(StatusEffect se)
    {
        //validate status effect here
        bool isNewStatusEffect = true;

        se.duration += efExtend;
        for (int i = 0; i < statusEffectList.Count; i++)
        {
            if (statusEffectList[i].StatusID == se.StatusID)
            {
                isNewStatusEffect = false;
                if (statusEffectList[i].level < se.level)
                {
                    statusEffectList[i].ResetEffect(this);
                    statusEffectList[i] = se;
                }
                else if (statusEffectList[i].level == se.level)
                {
                    statusEffectList[i].duration = Mathf.Max(statusEffectList[i].duration, se.duration);
                }
            }
        }
        if (isNewStatusEffect)
        {
            statusEffectList.Add(se);
            se.RunEffect(this);
        }
        if (se.isBuff)
        {
            GameObject.FindObjectOfType <CombatEngine>().PlayBuffFX(this);
        }
        else
        {
            GameObject.FindObjectOfType <CombatEngine>().PlayDebuffFX(this);
        }
    }
Example #30
0
 private bool IsVulnerable(ObjectMechanics target)
 {
     if (StatusEffect.HasEffectType(ref target.statusEffects, StatusEffect.EffectType.PETRIFIED))
     {
         return(false);
     }
     if (!target.canBeBackstabbed)
     {
         return(false);
     }
     if (IsBackstab(target))
     {
         return(true);
     }
     if (StatusEffect.HasEffectType(ref target.statusEffects, StatusEffect.EffectType.KNOCKDOWN))
     {
         return(true);
     }
     if (StatusEffect.HasEffectType(ref target.statusEffects, StatusEffect.EffectType.BLINDED))
     {
         return(true);
     }
     return(false);
 }
    void EmberRain()
    {
        int p = Target();

        if (p != 0)
        {
            GameObject hero  = GameObject.Find("P" + p);
            int        P1CSP = PlayerPrefs.GetInt("P" + p + "-CSP");
            int        P1SP  = PlayerPrefs.GetInt("P" + p + "-SP");
            SPSpend(p, P1CSP, P1SP, 4);
            for (int e = 1; e <= 8; e++)
            {
                if (PlayerPrefs.GetString("E" + e + "-Name") != "null")
                {
                    StatusEffect.InflictStatusEnemy("burning", e, 2);
                }
            }
            PlayerPrefs.SetInt("P" + p + "-TurnTaken", 1);
            hero.GetComponent <SpriteRenderer>().color = Color.grey;
            EndPlayerTurn();
        }
        PlayerPrefs.SetString("ActiveSkill", "None");
        PlayerPrefs.SetInt("ENumber", 0);
    }
Example #32
0
        public override void Update(float deltaTime, Camera cam)
        {
            if (item.body != null &&
                item.body.Enabled &&
                item.body.FarseerBody.Awake)
            {
                item.SetContainedItemPositions();
            }

            foreach (Pair <Item, StatusEffect> itemAndEffect in itemsWithStatusEffects)
            {
                Item contained = itemAndEffect.First;
                if (contained.Condition <= 0.0f)
                {
                    continue;
                }

                StatusEffect effect = itemAndEffect.Second;

                if (effect.HasTargetType(StatusEffect.TargetType.This))
                {
                    effect.Apply(ActionType.OnContaining, deltaTime, item, item.AllPropertyObjects);
                }
                if (effect.HasTargetType(StatusEffect.TargetType.Contained))
                {
                    effect.Apply(ActionType.OnContaining, deltaTime, item, contained.AllPropertyObjects);
                }
                if (effect.HasTargetType(StatusEffect.TargetType.NearbyItems) ||
                    effect.HasTargetType(StatusEffect.TargetType.NearbyCharacters))
                {
                    var targets = new List <ISerializableEntity>();
                    effect.GetNearbyTargets(item.WorldPosition, targets);
                    effect.Apply(ActionType.OnActive, deltaTime, item, targets);
                }
            }
        }
    void ManaShell()
    {
        int p = Target();

        if (p != 0)
        {
            GameObject hero  = GameObject.Find("P" + p);
            int        P1CSP = PlayerPrefs.GetInt("P" + p + "-CSP");
            int        P1SP  = PlayerPrefs.GetInt("P" + p + "-SP");
            SPSpend(p, P1CSP, P1SP, 16);
            StatusEffect.InflictStatusCharacter("counter", p, 3);
            SingleTargetSkills.SpecialCharge(p, 3, "Counterstrike");
            int guard     = PlayerPrefs.GetInt("P" + p + "-CG");
            int maxGuard  = PlayerPrefs.GetInt("P" + p + "-Guard");
            int guardGain = 4 * PlayerPrefs.GetInt("P" + p + "-END");
            if (guardGain > (maxGuard - guard))
            {
                guardGain = maxGuard - guard;
            }
            guard += guardGain;
            if (guard > maxGuard)
            {
                guard = maxGuard;
            }
            SingleTargetSkills.SpecialCharge(p, guardGain, "Iron Will");
            PlayerPrefs.SetInt("P" + p + "CombatGuardGained", PlayerPrefs.GetInt("P" + p + "CombatGuardGained") + guardGain);
            GameObject guardBar = GameObject.Find("P" + p + "-Guard");
            float      percent  = (float)guard / (float)maxGuard;
            guardBar.transform.localScale = new Vector3(percent, 1, 1);
            PlayerPrefs.SetInt("P" + p + "-TurnTaken", 1);
            hero.GetComponent <SpriteRenderer>().color = Color.grey;
            EndPlayerTurn();
        }
        PlayerPrefs.SetString("ActiveSkill", "None");
        PlayerPrefs.SetInt("ENumber", 0);
    }
Example #34
0
    /// <summary>
    /// Add a new status effect to the list of active effects.
    /// Managing for stacking properties, override properties
    /// Then tells the effect to start itself.
    /// </summary>
    /// <param name="effect">The effect obect to begin on the boat.</param>
    public void AddNewEffect(StatusEffect effect)
    {
        int currentStacksActive;

        //if the effect is not currently in the list
        //or if the effect has less than its maximum allowed amount of stacks in the list
        //or if the new effect always overrides existing effects no matter what
        //add the effect to the list
        if (!IsSameTypeEffectInList(effect, out currentStacksActive) || currentStacksActive < effect.GetMaxStacks() || effect.DoesOverrideExisting())
        {
            if (effect.DoesOverrideExisting())
            {
                Debug.Log("Overrideing existing status effects of type " + effect.GetType());
                RemoveSameTypeEffectsFromList(effect);
            }
            Debug.Log("Adding new status effect of type " + effect.GetType());
            effect.StartEffect(playerBoat);
            activeEffects.Add(effect);
        }
        else
        {
            Debug.Log("Could not add new status effect of type " + effect.GetType() + " since too many stacks already active");
        }
    }
Example #35
0
    private void CastIceWall(DamageInfo info)
    {
        if (isAOE)
        {
            Debug.LogError("NOT YET IMPLEMENTED!");
        }
        else
        {
            // create script and it to the tile object.
            IceBlock ib = info.targetTile.gameObject.AddComponent <IceBlock>();
            ib.CreateIceBlock(statusDuration, info.targetTile.position, info.targetTile.myType);

            // stun target.
            // set it to be invulnerable.
            if (info.targetTile.actor != null)
            {
                StatusEffect eff = StatusEffect.CreateEffect(StatusEffect.EffectType.Stun, 0, statusDuration);
                info.targetTile.actor.GetComponent <Actor>().AddStatusEffect(eff);

                eff = StatusEffect.CreateEffect(StatusEffect.EffectType.Invulnerable, 0, statusDuration);
                info.targetTile.actor.GetComponent <Actor>().AddStatusEffect(eff);
            }
        }
    }
    void AncientChampion()
    {
        int p = Target();

        if (p != 0)
        {
            PlayerPrefs.SetInt("Processing", 1);
            EnemyColumn();
            GameObject hero = GameObject.Find("P" + p);
            hero.GetComponent <SpriteRenderer>().color = Color.grey;
            for (int x = 1; x <= 25; x++)
            {
                if (PlayerPrefs.GetInt("Tile" + x + "Targeted") == 1)
                {
                    for (int e = 1; e <= 8; e++)
                    {
                        if (PlayerPrefs.GetInt("E" + e + "-Loc") == x)
                        {
                            Damage(p, e, PlayerPrefs.GetInt("E" + e + "-CHP"), PlayerPrefs.GetInt("E" + e + "-CG"), 6 + 2 * PlayerPrefs.GetInt("P" + p + "-INT"), "Magic");
                            StatusEffect.InflictStatusEnemy("jammed", e, 2);
                        }
                    }
                }
            }
            StatusEffect.InflictStatusCharacter("decoy", p, 2);
            SingleTargetSkills.SpecialCharge(p, 2, "Ancient Defender");
            PlayerPrefs.SetInt("P" + p + "-TurnTaken", 1);
            EndPlayerTurn();
        }
        PlayerPrefs.SetString("ActiveSkill", "None");
        PlayerPrefs.SetInt("ENumber", 0);
        for (int x = 1; x <= 25; x++)
        {
            PlayerPrefs.SetInt("Tile" + x + "Targeted", 0);
        }
    }
    public virtual void OnTurnStart()
    {
        if (OnStartTurn != null)
        {
            OnStartTurn(this);
        }

        for (int i = StatusEffects.Count - 1; i > -1; i--)
        {
            StatusEffect effect = StatusEffects[i];

            if (effect.tickTime == StatusEffect.TickTime.TurnStart)
            {
                effect.durationRemaining--;

                if (effect.durationRemaining < 1)
                {
                    RemoveStatusEffect(effect);
                }
            }
        }

        ResetBlock();
    }
Example #38
0
    void Backswing()
    {
        int p = Target();

        if (p != 0)
        {
            int        e    = PlayerPrefs.GetInt("ENumber");
            GameObject hero = GameObject.Find("P" + p);
            hero.GetComponent <SpriteRenderer>().color = Color.grey;
            int E1CHP  = PlayerPrefs.GetInt("E" + e + "-CHP");
            int E1CG   = PlayerPrefs.GetInt("E" + e + "-CG");
            int P1CSP  = PlayerPrefs.GetInt("P" + p + "-CSP");
            int P1SP   = PlayerPrefs.GetInt("P" + p + "-SP");
            int SPCost = 8;
            Damage(p, e, E1CHP, E1CG, 10 + 2 * PlayerPrefs.GetInt("P" + p + "-STR"), "Physical");
            SPSpend(p, P1CSP, P1SP, SPCost);
            StatusEffect.InflictStatusCharacter("counter", p, 1);
            SpecialCharge(p, 1, "Counterstrike");
            PlayerPrefs.SetInt("P" + p + "-TurnTaken", 1);
            EndPlayerTurn();
        }
        PlayerPrefs.SetString("ActiveSkill", "None");
        PlayerPrefs.SetInt("ENumber", 0);
    }
Example #39
0
        private static void Dia1(StatusEffectBuilder builder)
        {
            builder.Create(StatusEffectType.Dia1)
            .Name("Dia I")
            .EffectIcon(153)
            .GrantAction((target, duration) =>
            {
                if (StatusEffect.HasStatusEffect(target, StatusEffectType.Dia2) ||
                    StatusEffect.HasStatusEffect(target, StatusEffectType.Dia3))
                {
                    SendMessageToPC(target, "A more powerful version of Dia is already in effect.");
                    StatusEffect.Remove(target, StatusEffectType.Dia1);
                }
            })
            .TickAction((activator, target) =>
            {
                var damage = Random.D2(1);

                AssignCommand(activator, () =>
                {
                    ApplyEffectToObject(DurationType.Instant, EffectDamage(damage, DamageType.Positive), target);
                });
            });
        }
Example #40
0
    // =====================================================
    // | States
    // =====================================================

    protected override void ExecuteActionAttack()
    {
        // Get the targets of the attack
        AttackCollider            attackCollider = parameters.creature.GetHitColliderFromDirection();
        List <KillableGridObject> targets        = attackCollider.GetKillList();

        if (targets.Count > 0)
        {
            // Puts attack on cooldown
            canAttack = false;

            // Damage each target
            foreach (KillableGridObject target in targets)
            {
                if (target.faction != parameters.creature.faction)
                {
                    target.TakeDamage(parameters.creature.damage);

                    // Apply status effect to targets
                    StatusEffect.ApplyStatusEffect(parameters.creature, target, parameters.spinStun);
                }
            }
        }
    }
 public void btnToggleStatus_Click()
 {
     lock (GameBase.lockObj)
     {
         DevForm.SetConfig("StatusChoice", chosenStatus);
         StatusData entry = DataManager.Instance.GetStatus(chosenStatus);
         if (GameManager.Instance.CurrentScene == DungeonScene.Instance)
         {
             if (DungeonScene.Instance.ActiveTeam.Players.Count > 0 && DungeonScene.Instance.FocusedCharacter != null)
             {
                 Character player = DungeonScene.Instance.FocusedCharacter;
                 if (entry.Targeted)
                 {
                     DungeonScene.Instance.LogMsg(String.Format("This is a targeted status."), false, true);
                 }
                 else
                 {
                     if (player.StatusEffects.ContainsKey(chosenStatus))
                     {
                         DungeonScene.Instance.PendingDevEvent = player.RemoveStatusEffect(chosenStatus);
                     }
                     else
                     {
                         StatusEffect status = new StatusEffect(chosenStatus);
                         status.LoadFromData();
                         DungeonScene.Instance.PendingDevEvent = player.AddStatusEffect(status);
                     }
                 }
             }
         }
         else
         {
             GameManager.Instance.SE("Menu/Cancel");
         }
     }
 }
Example #42
0
        public static void LoadStatusEffectScript(StatusEffect effect)
        {
            string path = $"./scripts/effects/{effect.GetName()}.lua";

            if (File.Exists(path))
            {
                var script = LoadGlobals();

                try
                {
                    script.DoFile(path);
                }
                catch (Exception e)
                {
                    Program.Log.Error($"LuaEngine.CallLuaBattleCommandFunction {e.Message}");
                }
                effect.script = script;
            }
            else
            {
                path = $"./scripts/effects/default.lua";
                //Program.Log.Error($"LuaEngine.CallLuaBattleCommandFunction [{command.name}] Unable to find script {path}");
                var script = LoadGlobals();

                try
                {
                    script.DoFile(path);
                }
                catch (Exception e)
                {
                    Program.Log.Error($"LuaEngine.CallLuaBattleCommandFunction {e.Message}");
                }

                effect.script = script;
            }
        }
Example #43
0
    void Poison()
    {
        int p = Target();

        PlayerPrefs.SetInt("Processing", 1);
        int        e     = PlayerPrefs.GetInt("ENumber");
        Vector3    EBox5 = this.transform.position;
        GameObject animg = GameObject.Find("Fire");
        Animator   anim  = animg.GetComponent <Animator>();

        animg.transform.position = EBox5;
        anim.SetTrigger("Play");
        Vector3    ScreenPos = new Vector3(0, -538, -100);
        GameObject InputDiss = GameObject.Find("InputDiss");

        InputDiss.transform.position = ScreenPos;
        Invoke("EndAnimationFire", 0.8f);
        string status = "poison";

        SPSpend(p, 5);
        StatusEffect.InflictStatusEnemy(status, e, 5);
        EndSkill(p);
        SkillReset();
    }
Example #44
0
 private void InsertStatusEffect(StatusEffect statusEffect)
 {
     if (_statusEffects.Count == 0)
     {
         _statusEffects.Add(statusEffect);
         _statusIcon.SetStatusEffect(_statusEffects, _statusEffects[0]._durationTime);
     }
     else
     {
         for (int i = 0; i < _statusEffects.Count; i++)
         {
             if (_statusEffects[i].Kind != statusEffect.Kind)
             {
                 _statusEffects.Add(statusEffect);
             }
             else
             {
                 _statusEffects[i]._durationTime = 5f; //변수로 치환
             }
             _statusIcon.SetStatusEffect(_statusEffects, _statusEffects[i]._durationTime);
             //현재 리스트 전달 및 지속시간 전달
         }
     }
 }
Example #45
0
        public ItemComponent(Item item, XElement element)
        {
            this.item = item;

            properties = ObjectProperty.GetProperties(this);

            //canBePicked = ToolBox.GetAttributeBool(element, "canbepicked", false);
            //canBeSelected = ToolBox.GetAttributeBool(element, "canbeselected", false);

            //msg = ToolBox.GetAttributeString(element, "msg", "");

            requiredItems = new List <RelatedItem>();

            requiredSkills = new List <Skill>();

#if CLIENT
            sounds = new Dictionary <ActionType, List <ItemSound> >();
#endif

            SelectKey = InputType.Select;

            try
            {
                string selectKeyStr = ToolBox.GetAttributeString(element, "selectkey", "Select");
                selectKeyStr = ToolBox.ConvertInputType(selectKeyStr);
                SelectKey    = (InputType)Enum.Parse(typeof(InputType), selectKeyStr, true);
            }
            catch (Exception e)
            {
                DebugConsole.ThrowError("Invalid select key in " + element + "!", e);
            }

            PickKey = InputType.Select;

            try
            {
                string pickKeyStr = ToolBox.GetAttributeString(element, "selectkey", "Select");
                pickKeyStr = ToolBox.ConvertInputType(pickKeyStr);
                PickKey    = (InputType)Enum.Parse(typeof(InputType), pickKeyStr, true);
            }
            catch (Exception e)
            {
                DebugConsole.ThrowError("Invalid pick key in " + element + "!", e);
            }

            properties = ObjectProperty.InitProperties(this, element);

            foreach (XElement subElement in element.Elements())
            {
                switch (subElement.Name.ToString().ToLowerInvariant())
                {
                case "requireditem":
                case "requireditems":
                    RelatedItem ri = RelatedItem.Load(subElement);
                    if (ri != null)
                    {
                        requiredItems.Add(ri);
                    }
                    break;

                case "requiredskill":
                case "requiredskills":
                    string skillName = ToolBox.GetAttributeString(subElement, "name", "");
                    requiredSkills.Add(new Skill(skillName, ToolBox.GetAttributeInt(subElement, "level", 0)));
                    break;

                case "statuseffect":
                    var statusEffect = StatusEffect.Load(subElement);

                    if (statusEffectLists == null)
                    {
                        statusEffectLists = new Dictionary <ActionType, List <StatusEffect> >();
                    }

                    List <StatusEffect> effectList;
                    if (!statusEffectLists.TryGetValue(statusEffect.type, out effectList))
                    {
                        effectList = new List <StatusEffect>();
                        statusEffectLists.Add(statusEffect.type, effectList);
                    }

                    effectList.Add(statusEffect);

                    break;

                default:
                    if (LoadElemProjSpecific(subElement))
                    {
                        break;
                    }
                    ItemComponent ic = Load(subElement, item, item.ConfigFile, false);
                    if (ic == null)
                    {
                        break;
                    }

                    ic.Parent = this;
                    item.components.Add(ic);
                    break;
                }
            }
        }
Example #46
0
	public Skill (Sprite skillSprite = null, string theName = "", int theLevel = 1, float theBaseDamage = 1, float theEnergyCost = 1, float theCooldown = 0, StatusEffect theStatusEffect = StatusEffect.None, float theChanceOfEffect = 0, float theDurationOfEffect = 0) {
		sprite = skillSprite;
		name = theName;
		level = theLevel;
		baseDamage = theBaseDamage;
		energyCost = theEnergyCost;
		cooldown = theCooldown;
		statusEffect = theStatusEffect;
		chanceOfEffect = theChanceOfEffect;
		durationOfEffect = theDurationOfEffect;
	}
Example #47
0
        // Token: 0x0600001E RID: 30 RVA: 0x000036BC File Offset: 0x000018BC
        protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
        {
            bool         flag = false;
            StatusEffect parentStatusEffect = this.m_parentStatusEffect;
            bool         flag2 = parentStatusEffect != null;

            if (flag2)
            {
                bool flag3 = parentStatusEffect.Age > 10f && !this.buffsWereReceived;
                if (flag3)
                {
                    bool flag4 = !_affectedCharacter.StatusEffectMngr.HasStatusEffect(Templar.Instance.prayerCooldownStatusEffectInstance.IdentifierName);
                    if (flag4)
                    {
                        _affectedCharacter.StatusEffectMngr.AddStatusEffect(ResourcesPrefabManager.Instance.GetStatusEffectPrefab("Bless"), _affectedCharacter);
                        _affectedCharacter.StatusEffectMngr.AddStatusEffect(Templar.Instance.prayerCooldownStatusEffectInstance, _affectedCharacter);
                        bool flag5 = _affectedCharacter.Inventory.SkillKnowledge.IsItemLearned(2502002);
                        if (flag5)
                        {
                            _affectedCharacter.StatusEffectMngr.AddStatusEffect(Templar.Instance.burstOfDivinityInstance, _affectedCharacter);
                        }
                    }
                    else
                    {
                        bool isLocalPlayer = _affectedCharacter.IsLocalPlayer;
                        if (isLocalPlayer)
                        {
                            _affectedCharacter.CharacterUI.ShowInfoNotification(Templar.Instance.prayerCooldownStatusEffectInstance.Description);
                        }
                    }
                    this.buffsWereReceived = true;
                }
                bool flag6 = parentStatusEffect.Age > 10f && !this.trainerWasOpened;
                if (flag6)
                {
                    bool isLocalPlayer2 = _affectedCharacter.IsLocalPlayer;
                    if (isLocalPlayer2)
                    {
                        bool    flag7           = false;
                        Vector3 position        = _affectedCharacter.transform.position;
                        Vector3 eulerAngles     = _affectedCharacter.transform.rotation.eulerAngles;
                        string  activeSceneName = SceneManagerHelper.ActiveSceneName;
                        string  text            = activeSceneName;
                        if (text != null)
                        {
                            if (!(text == "Chersonese_Dungeon4_HolyMission"))
                            {
                                if (text == "Monsoon")
                                {
                                    bool flag8 = position.x <-174f && (double)position.x> -176.5 && position.z <755f && position.z> 753f;
                                    if (flag8)
                                    {
                                        bool flag9 = eulerAngles.y <24f || eulerAngles.y> 330f;
                                        if (flag9)
                                        {
                                            flag7 = true;
                                        }
                                    }
                                    bool flag10 = position.x <-374f && (double)position.x> -375.8 && (double)position.z <766.5 && (double)position.z> 764.5;
                                    if (flag10)
                                    {
                                        bool flag11 = eulerAngles.y <190f && eulerAngles.y> 140f;
                                        if (flag11)
                                        {
                                            flag7 = true;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                bool flag12 = position.x <-12.5f && (double)position.x> -16.5 && position.z <-18f && position.z> -20f;
                                if (flag12)
                                {
                                    bool flag13 = eulerAngles.y <10f || eulerAngles.y> 320f;
                                    if (flag13)
                                    {
                                        flag7 = true;
                                    }
                                }
                            }
                        }
                        bool flag14 = flag7;
                        if (flag14)
                        {
                            Trainer trainer = new Trainer();
                            At.SetValue <UID>(UID.Generate(), typeof(Trainer), trainer, "m_uid");
                            At.SetValue <UID>(Templar.templarTreeInstance.UID, typeof(Trainer), trainer, "m_skillTreeUID");
                            trainer.StartTraining(_affectedCharacter);
                            this.trainerWasOpened = true;
                        }
                    }
                }
                bool flag15 = (double)((_affectedCharacter != null) ? _affectedCharacter.AnimMoveSqMagnitude : 0f) > 0.1 && parentStatusEffect.Age > 0.5f;
                if (flag15)
                {
                    flag = true;
                }
            }
            else
            {
                flag = true;
            }
            bool flag16 = flag;

            if (flag16)
            {
                StatusEffectManager statusEffectMngr = _affectedCharacter.StatusEffectMngr;
                if (statusEffectMngr != null)
                {
                    statusEffectMngr.CleanseStatusEffect("Prayer");
                }
                _affectedCharacter.ForceCancel(true, true);
            }
        }
Example #48
0
	public void LevelUp () {
		ResetCurrentExperiencePoints();
		playerLevel++;


		// increase stats
		attackStat = baseAttackStat * playerLevel;
		maxHealth = baseHealth * playerLevel;
		maxEnergy = baseEnergy * playerLevel;

		// restore health and status
		Heal (maxHealth);
		currentStatus = StatusEffect.None;


		if (currentExperiencePoints >= GetExperiencePointsForNextLevel()) {
			LevelUp();
		}
	}
Example #49
0
	public void SetCurrentStatus (StatusEffect newStatus) {
		currentStatus = newStatus;
	}
Example #50
0
 public void ReceiveStatusEffect(StatusEffect status)
 {
 }
Example #51
0
	// Use this for initialization
	void Awake () {
		skill1 = new Skill (skillSprite1, skillName1, levelOfSkill1, baseDamage1, energyCost1, cooldownTime1, statusEffectOfSkill1, chanceOfStatusEffect1, statusEffectDurationInSeconds1);
		skill2 = new Skill (skillSprite2, skillName2, levelOfSkill2, baseDamage2, energyCost2, cooldownTime2, statusEffectOfSkill2, chanceOfStatusEffect2, statusEffectDurationInSeconds2);
		skill3 = new Skill (skillSprite3, skillName3, levelOfSkill3, baseDamage3, energyCost3, cooldownTime3, statusEffectOfSkill3, chanceOfStatusEffect3, statusEffectDurationInSeconds3);
		currentHealth = maxHealth;
		currentStatus = StatusEffect.None;

		bossStatusController = GameObject.FindObjectOfType<BossStatusController>();

		skill1ButtonObject = GameObject.Find("Skill 1");
		skill2ButtonObject = GameObject.Find("Skill 2");
		skill3ButtonObject = GameObject.Find("Skill 3");
	}
Example #52
0
 public override void ApplyStatus(CombatEntity caster, StatusEffect statusEffect)
 {
     throw new System.NotImplementedException();
 }
 public override void Stack(StatusEffect sameEffect)
 {
     buffTimer = maxBuffTimer;
 }
Example #54
0
 public StatusEffectRef(StatusEffect effect)
 {
     this.effect = effect;
 }
Example #55
0
    //defend does not work right now
    void OnMouseDown()
    {
        PlayerPrefs.SetInt("Clicked", 0);
        int p = Clicked();

        PlayerPrefs.SetInt("Processing", 1);
        GameObject hero = GameObject.Find("P" + p);

        hero.GetComponent <SpriteRenderer>().color = Color.grey;
        GameObject charstatbox = GameObject.Find("CharStatBox");

        charstatbox.GetComponent <Text>().text = "";
        int PCurrentGuard = PlayerPrefs.GetInt("P" + p + "-CG");
        int PMaxGuard     = PlayerPrefs.GetInt("P" + p + "-Guard");
        int PAddedGuard   = 2 * PlayerPrefs.GetInt("P" + p + "-END");

        PCurrentGuard += PAddedGuard;
        if (PCurrentGuard > PMaxGuard)
        {
            PCurrentGuard = PMaxGuard;
        }
        SingleTargetSkills.SpecialCharge(p, PAddedGuard, "Iron Will");
        PlayerPrefs.SetInt("P" + p + "CombatGuardGained", PlayerPrefs.GetInt("P" + p + "CombatGuardGained") + PAddedGuard);
        GameObject GBar     = GameObject.Find("P" + p + "-Guard");
        float      PercentG = ((float)PCurrentGuard / (float)PMaxGuard);

        GBar.gameObject.transform.localScale = new Vector3(PercentG, 1, 1);
        PlayerPrefs.SetInt("P" + p + "-CG", PCurrentGuard);
        StatusEffect.InflictStatusCharacter("steadfast", p, 1);
        PlayerPrefs.SetInt("P" + p + "-TurnTaken", 1);
        PlayerPrefs.SetString("ActiveSkill", "None");
        PlayerPrefs.SetInt("ENumber", 0);
        for (int i = 0; i <= 3; i++)
        {
            if (PlayerPrefs.GetString("P" + p + "Status" + i) == "burning")
            {
                PlayerPrefs.SetString("P" + p + "Status" + i, "null");
                PlayerPrefs.SetInt("P" + p + "Status" + i + "X", 0);
            }
        }
        if (PlayerPrefs.GetString("P" + p + "-PassiveSkill") == "Iron Will1")
        {
            int e = RandomEnemy();
            Damage(p, e, PlayerPrefs.GetInt("E" + e + "-CHP"), PlayerPrefs.GetInt("E" + e + "-CG"), 3, "Magic");
        }
        else if (PlayerPrefs.GetString("P" + p + "-PassiveSkill") == "Iron Will2")
        {
            int e = RandomEnemy();
            Damage(p, e, PlayerPrefs.GetInt("E" + e + "-CHP"), PlayerPrefs.GetInt("E" + e + "-CG"), 5, "Magic");
        }
        else if (PlayerPrefs.GetString("P" + p + "-PassiveSkill") == "Iron Will3")
        {
            int e = RandomEnemy();
            Damage(p, e, PlayerPrefs.GetInt("E" + e + "-CHP"), PlayerPrefs.GetInt("E" + e + "-CG"), 8, "Magic");
        }
        else if (PlayerPrefs.GetString("P" + p + "-PassiveSkill") == "Counterstrike2")
        {
            int e = RandomEnemy();
            StatusEffect.InflictStatusEnemy("alarm", e, 1);
        }
        else if (PlayerPrefs.GetString("P" + p + "-PassiveSkill") == "Counterstrike3")
        {
            int e = RandomEnemy();
            StatusEffect.InflictStatusEnemy("alarm", e, 2);
        }
        EndPlayerTurn();
    }
Example #56
0
 public void RemoveIcon(StatusEffect name)
 {
     _icons.Remove(name);
     UpdateIcons();
     Logger.InfoS("statuseffects", $"Removed icon {name}");
 }
Example #57
0
 /// <summary>
 /// 指定したBUFFがかかっているあ
 /// </summary>
 /// <param name="iStatusEffect">BUFF</param>
 /// <returns>指定したBUFFがかかっていたらTRUEを返す</returns>
 public bool IsBuff(StatusEffect iStatusEffect)
 {
     if (fface.Player.StatusEffects.Contains(iStatusEffect)) return true;
     return false;
 }
Example #58
0
 private bool plStatusCheck(StatusEffect requestedStatus)
 {
     bool statusFound = false;
     foreach (StatusEffect status in _FFACEPL.Player.StatusEffects)
     {
         if (requestedStatus == status)
         {
             statusFound = true;
         }
     }
     return statusFound;
 }
Example #59
0
 public Status()
 {
     StatusEffect = StatusEffect.None;
 }
Example #60
0
 private bool IsAbilityActive(StatusEffect ability)
 {
     StatusEffect[] statuseffects = Session.Player.StatusEffects;
     foreach (var statusEffect in statuseffects)
     {
         if (statusEffect == ability)
             return true;
     }
     return false;
 }