Exemplo n.º 1
0
        public void OnQRCode(string content)
        {
            if (qr != null)
            {
                return;
            }

            bool blackList = QRPromptEffect.SelectionType == QRPromptEffect.ListType.BlackList;
            bool contained = QRPromptEffect.ValidIds.Contains(content);

            if ((blackList && !contained) || (!blackList && contained))
            {
                qr = Game.Instance.GameState.FindElement <QR>(content);
                if (qr != null && ConditionChecker.check(qr.Conditions))
                {// Si existe y además cumple las condiciones
                    // Mostramos el contenido y el resto de efectos
                    var effects = new Effects();
                    if (qr.Content != "")
                    {
                        effects.add(new SpeakPlayerEffect(qr.Content));
                    }
                    foreach (var effect in qr.Effects.getEffects())
                    {
                        effects.add(effect);
                    }

                    effectHolder = new EffectHolder(effects);
                    this.transform.GetChild(0).gameObject.SetActive(false);
                }
            }
        }
Exemplo n.º 2
0
 public void SetEffectHolder(EffectHolder newEffectHolder)
 {
     if (newEffectHolder != null)
     {
         effectHolder = newEffectHolder;
     }
 }
        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.Text != "Character")
            {
                comboBox3.DataSource = new string[1] {
                    ""
                };
                comboBox3.SelectedIndex = 0;
                comboBox4.DataSource    = new string[1] {
                    ""
                };
                comboBox4.SelectedIndex = 0;
            }
            _data.Branch2 = comboBox2.Text;
            switch (comboBox2.Text)
            {
            case "SpellEffects":
                comboBox3.DataSource    = EffectHolder.allEffectTagsAndTypes();
                comboBox3.SelectedIndex = 0;
                break;

            case "AttackResult":
                comboBox3.DataSource    = Enum.GetValues(typeof(Utilities.AttackResultType));
                comboBox3.SelectedIndex = 0;
                break;
            }
        }
        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
        {
            comboBox4.DataSource = new string[1] {
                ""
            };
            comboBox4.SelectedIndex = 0;
            _data.Branch3           = comboBox3.Text;
            switch (comboBox3.Text)
            {
            case "Effects":
                comboBox4.DataSource    = EffectHolder.allEffectTagsAndTypes();
                comboBox4.SelectedIndex = 0;
                break;

            case "SelectedWeaponName":
                comboBox4.DataSource    = Utilities.GetWeaponNames();
                comboBox4.SelectedIndex = 0;
                break;

            case "SelectedWeaponType":
                comboBox4.DataSource    = Enum.GetValues(typeof(Utilities.WeaponType));
                comboBox4.SelectedIndex = 0;
                break;

            case "CreatureType":
                comboBox4.DataSource    = Enum.GetValues(typeof(Utilities.CreatureType));
                comboBox4.SelectedIndex = 0;
                break;
            }
        }
Exemplo n.º 5
0
 public CPlayerInstance(FightManager fightManager, Region region, PlayerKnownList objectKnownList,
                        StatHolder stats, IItemHolder items, EffectHolder effects, IEnumerable <ICharacterData> characterDatas)
     : base(region, objectKnownList, stats, items, effects, characterDatas)
 {
     Destination  = new Position();
     FightManager = fightManager;
 }
Exemplo n.º 6
0
 protected Card(string Path, string CardType)
 {
     this.Path     = Path;
     this.CardType = CardType;
     Effects       = new EffectHolder();
     ListSkill     = new List <BaseAutomaticSkill>();
 }
Exemplo n.º 7
0
        public Character()
        {
            _EXP    = new SharableInt32();
            _Level  = new SharableInt32();
            BaseMEL = new SharableInt32();
            BaseRNG = new SharableInt32();
            BaseDEF = new SharableInt32();
            BaseSKL = new SharableInt32();
            BaseEVA = new SharableInt32();
            BaseHIT = new SharableInt32();

            _EXP.Value    = 0;
            _Level.Value  = 0;
            BaseMEL.Value = 0;
            BaseRNG.Value = 0;
            BaseDEF.Value = 0;
            BaseSKL.Value = 0;
            BaseEVA.Value = 0;
            BaseHIT.Value = 0;

            ArrayPilotSkill        = new BaseAutomaticSkill[0];
            ArrayRelationshipBonus = new BaseAutomaticSkill[0];
            ArrayPilotSpirit       = new ManualSkill[0];

            TerrainGrade = new TerrainGrades(0, 0, 0, 0);

            MaxWill                = 150;
            Will                   = 100;
            TeamTags               = new TagSystem();
            Effects                = new EffectHolder();
            DicCharacterLink       = new Dictionary <string, CharacterLinkTypes>();
            ListQuoteSetVersusName = new List <string>();
            DicAttackQuoteSet      = new Dictionary <string, QuoteSet>();
        }
Exemplo n.º 8
0
 public void AddAndExecuteEffect(ManualSkill ActiveSkill, EffectHolder Effects)
 {
     for (int E = ActiveSkill.ListEffect.Count - 1; E >= 0; --E)
     {
         //Init Skill.
         Effects.AddAndExecuteEffect(ActiveSkill.ListEffect[E], ActiveSkill.Name);
     }
 }
Exemplo n.º 9
0
    public void Init(EffectHolder effectHolder, GameObject owner, float intensity)
    {
        this.effectHolder = effectHolder;
        this.owner        = owner;
        this.intensity    = intensity;

        initalized = true;
    }
        public double Trigger(EnchantmentParameters ep)
        {
            double?pot = potency.Calculate(ep);
            double?len = length.Calculate(ep);
            double?det = deterioration.Calculate(ep);

            if (pot != null && len != null && det != null)
            {
                double p = (double)pot;
                double l = (double)len;
                double d = (double)det;

                Character charToEffect = getCharByAccessString(ep, target.ToString());
                if (charToEffect.CombatStuff == null ||
                    charToEffect.CombatStuff.CombatName == "" ||
                    !CombatHolder._inCombatChars.Any(A => A.CombatStuff.CombatName == charToEffect.CombatStuff.CombatName))
                {
                    return(0.0);
                }
                EffectHolder.EffectType efftype;
                bool parsedType = Enum.TryParse(EnchantmentUtilities.checkForVariable(effectType, this), out efftype);
                if (effectType != null && effectType != "" && !parsedType)
                {
                    MessageBox.Show("Invalid effect Type");
                    return(0.0);
                }
                EffectHolder.EffectTag efftag;
                bool parsedTag = Enum.TryParse(EnchantmentUtilities.checkForVariable(effectTag, this), out efftag);
                if (effectTag != null && effectTag != "" && !parsedTag)
                {
                    MessageBox.Show("Invalid effect tag");
                    return(0.0);
                }
                Utilities.DamageType?damtype;
                Utilities.DamageType tempdamtype;
                bool parsedDam = Enum.TryParse(EnchantmentUtilities.checkForVariable(damageType, this), out tempdamtype);
                damtype = tempdamtype;
                if (EnchantmentUtilities.checkForVariable(damageType, this) == "")
                {
                    damtype = null;
                }
                if (damageType != null && damageType != "" && !parsedDam)
                {
                    MessageBox.Show("Invalid damage Type");
                    return(0.0);
                }
                Effect e = new Effect(efftype, p, (int)l, d);
                e.effectTag = efftag;

                Utilities.forceTypesToConformToTag(e);

                e.damageType = damtype;

                EffectHolder.CreateEffect(e, charToEffect, false);
            }
            return(0.0);
        }
Exemplo n.º 11
0
    public List <Material> GetMaterials()
    {
        if (!active)
        {
            return(null);
        }
        Init();

        if (effectHolders.Count > 0)
        {
            Camera  cam    = Camera.current;
            Vector3 camPos = cam.transform.position;

            SortFarToNear(camPos);

            for (int i = 0; i < effectHolders.Count; i++)
            {
                EffectHolder effectHolder       = effectHolders[i];
                Material     underwaterMaterial = null;
                // Oceans
                if (displayOceans)
                {
                    if (effectHolder.oceanEffect != null)
                    {
                        effectHolder.oceanEffect.UpdateSettings(effectHolder.generator, oceanShader);

                        float camDstFromCentre = (camPos - effectHolder.generator.transform.position).magnitude;
                        if (camDstFromCentre < effectHolder.generator.GetOceanRadius())
                        {
                            underwaterMaterial = effectHolder.oceanEffect.GetMaterial();
                        }
                        else
                        {
                            postProcessingMaterials.Add(effectHolder.oceanEffect.GetMaterial());
                        }
                    }
                }
                // Atmospheres
                if (displayAtmospheres)
                {
                    if (effectHolder.atmosphereEffect != null)
                    {
                        effectHolder.atmosphereEffect.UpdateSettings(effectHolder.generator);
                        postProcessingMaterials.Add(effectHolder.atmosphereEffect.GetMaterial());
                    }
                }

                if (underwaterMaterial != null)
                {
                    postProcessingMaterials.Add(underwaterMaterial);
                }
            }
        }

        return(postProcessingMaterials);
    }
Exemplo n.º 12
0
        public MagicUser()
        {
            MaxMana       = 100;
            CurrentMana   = MaxMana;
            ChanneledMana = 0;
            ManaReserves  = 0;

            Effects        = new EffectHolder();
            ListLinkedUser = new List <IMagicUser>();
        }
        public MagicEffect(string EffectTypeName, bool IsPassive, MagicUserParams MagicParams)
            : base(EffectTypeName, IsPassive)
        {
            Effects        = new EffectHolder();
            ListLinkedUser = new List <IMagicUser>();

            if (MagicParams != null)
            {
                this.MagicParams = new MagicUserParams(MagicParams);
            }
        }
Exemplo n.º 14
0
        public bool CanActivateEffectsOnTarget(EffectHolder Effects)
        {
            //Make sure the PilotSkill can be used on this Character.
            for (int E = ListEffect.Count - 1; E >= 0; --E)
            {
                if (Effects.CanAddEffect(ListEffect[E], Name) && ListEffect[E].CanActivate())
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 15
0
 protected CCharacter(Region region, CharacterKnownList objectKnownList, IStatHolder stats, IItemHolder items, EffectHolder effects, IEnumerable <ICharacterData> characterDatas)
     : base(region, objectKnownList)
 {
     Stats           = stats;
     Stats.Character = this;
     Items           = items;
     Items.Character = this;
     _characterData  = new Dictionary <Type, ICharacterData>();
     foreach (var charData in characterDatas)
     {
         charData.Owner = this;
         _characterData.Add(charData.GetType(), charData);
     }
     Effects         = effects;
     Effects.Owner   = this;
     StatusListeners = new List <ICharacter>();
 }
Exemplo n.º 16
0
        public Dictionary <string, string> DicStoredVariable;// Used for extra stuff

        private RobotAnimation()
            : base()
        {
            IsUpdated                  = true;
            Camera                     = new Rectangle(0, 0, Constants.Width, Constants.Height);
            InputManager               = new NullRobotInput();
            InputManagerHelper         = new NullRobotInputManager();
            PrimaryWeapons             = new WeaponHolder(0);
            IsInAir                    = false;
            CurrentLane                = 1350;
            CollisionBox               = new CollisionObject <RobotAnimation>();
            ListCollidingGroundPolygon = new List <WorldPolygon>();
            ListIgnoredGroundPolygon   = new List <WorldPolygon>();
            Effects                    = new EffectHolder();
            ListMagicSpell             = new List <MagicSpell>();
            ListMagicSpell.Add(new MagicSpell(null));
            DicStoredVariable = new Dictionary <string, string>();
        }
    public ConversationNodeHolder(ConversationNode node)
    {
        this.node = node;

        if (node != null) {
            switch (node.getType ()) {
            case ConversationNodeViewEnum.DIALOGUE:
                DialogueConversationNode dialog = (DialogueConversationNode)node;
                this.additional_effects = new EffectHolder (((DialogueConversationNode)node).getEffects ());
                this.child = 0;
                break;
            case ConversationNodeViewEnum.OPTION:
                this.additional_effects = new EffectHolder (((OptionConversationNode)node).getEffects ());
                this.child = -2;
                break;
            }
        }
    }
Exemplo n.º 18
0
    public ConversationNodeHolder(ConversationNode node)
    {
        this.node = node;

        if (node != null)
        {
            switch (node.getType())
            {
            case ConversationNodeViewEnum.DIALOGUE:
                DialogueConversationNode dialog = (DialogueConversationNode)node;
                this.additional_effects = new EffectHolder(((DialogueConversationNode)node).getEffects());
                this.child = 0;
                break;

            case ConversationNodeViewEnum.OPTION:
                this.additional_effects = new EffectHolder(((OptionConversationNode)node).getEffects());
                this.child = -2;
                break;
            }
        }
    }
        public double?CalculateWithCharacter(Character c)
        {
            string Branch3forcalc = EnchantmentUtilities.checkForVariable(Branch3, this);
            string Branch4forcalc = EnchantmentUtilities.checkForVariable(Branch4, this);

            switch (Branch3forcalc)
            {
            case "Strength":
                return(c.Statistics.Strength + EffectHolder.GetValidEffectsByEffect(c, EffectHolder.EffectType.Strength, true));

            case "Dexterity":
                return(c.Statistics.Dexterity + EffectHolder.GetValidEffectsByEffect(c, EffectHolder.EffectType.Dexterity, true));

            case "Constitution":
                return(c.Statistics.Constitution + EffectHolder.GetValidEffectsByEffect(c, EffectHolder.EffectType.Constitution, true));

            case "Intelligence":
                return(c.Statistics.Intelligence + EffectHolder.GetValidEffectsByEffect(c, EffectHolder.EffectType.Intelligence, true));

            case "Wisdom":
                return(c.Statistics.Wisdom + EffectHolder.GetValidEffectsByEffect(c, EffectHolder.EffectType.Wisdom, true));

            case "Charisma":
                return(c.Statistics.Charisma + EffectHolder.GetValidEffectsByEffect(c, EffectHolder.EffectType.Charisma, true));

            case "Health":
                return(c.HitPoints);

            case "Stamina":
                return(c.Stamina);

            case "SelectedWeaponName":
                if (c.CombatStuff == null || c.CombatStuff.CombatWeapon == null)
                {
                    return(null);
                }
                double ret = 0;
                if (c.CombatStuff.CombatWeapon.ItemName == Branch4forcalc)
                {
                    ret = 1;
                }
                return(ret);

            case "SelectedWeaponType":
                if (c.CombatStuff == null || c.CombatStuff.CombatWeapon == null || c.CombatStuff.CombatWeapon.WeaponTypes == null)
                {
                    return(null);
                }
                double ret3 = 0;
                if (c.CombatStuff.CombatWeapon.WeaponTypes.Any(A => A.ToString() == Branch4forcalc))
                {
                    ret3 = 1;
                }
                return(ret3);

            case "Effects":
                EffectHolder.EffectType ety;
                EffectHolder.EffectTag  eta;

                Enum.TryParse(Branch4forcalc, out ety);
                Enum.TryParse(Branch4forcalc, out eta);
                if (ety.ToString() == Branch4forcalc)
                {
                    return(EffectHolder.GetValidEffectsByTag(c, eta, false));
                }
                return(EffectHolder.GetValidEffectsByEffect(c, ety, false));

            case "IsParentChar":
                double ret1 = 0;
                if (c == GetParentChar())
                {
                    ret1 = 1;
                }
                return(ret1);

            case "CreatureType":
                if (c.CreatureTypes == null)
                {
                    return(null);
                }
                double ret2 = 0;
                if (c.CreatureTypes.Any(A => A.ToString() == Branch4forcalc))
                {
                    ret2 = 1;
                }
                return(ret2);

            default:
                return(0);
            }
        }
Exemplo n.º 20
0
 public CBotInstance(byte level, Region region, CharacterKnownList objectKnownList, StatHolder stats, IItemHolder items, EffectHolder effects,
                     IEnumerable <ICharacterData> charData)
     : base(region, objectKnownList, stats, items, effects, charData)
 {
     Stats.SetStat <Level>(level);
     ObjectId = Math.Abs(Guid.NewGuid().GetHashCode());
     Name     = botNames[new Random().Next(0, botNames.Count)];
 }
Exemplo n.º 21
0
            protected virtual void Execute()
            {
                EffectHolder eh = new EffectHolder(Action.Effects);

                Game.Instance.Execute(eh, ActionFinished);
            }
 public MagicEffect(string EffectTypeName, bool IsPassive)
     : base(EffectTypeName, IsPassive)
 {
     Effects        = new EffectHolder();
     ListLinkedUser = new List <IMagicUser>();
 }
Exemplo n.º 23
0
 public void SetOwner(GameObject newOwner)
 {
     owner        = newOwner.GetComponent <CreatureStats>();
     OwnerEffects = newOwner.GetComponent <EffectHolder>();
 }
Exemplo n.º 24
0
 public CPlayable(Region region, PlayableKnownList objectKnownList, IStatHolder stats, IItemHolder items, EffectHolder effects, IEnumerable <ICharacterData> charData)
     : base(region, objectKnownList, stats, items, effects, charData)
 {
 }
Exemplo n.º 25
0
 public void AddEffectHolder(EffectHolder newEffectHolder)
 {
     effects.Add(newEffectHolder);
 }
Exemplo n.º 26
0
 private void Start()
 {
     current = this;
 }