コード例 #1
0
    public override EffectProperties getEffectPropertiesStructure(bool forGUI)
    {
        EffectProperties properties = new EffectProperties(GetType().Name, numberOfEffectProperties, forGUI);

        if (forGUI)
        {
            properties.valueTypeName[0] = typeof(DamageTypes).Name;
            properties.propertyName[0]  = "damageTypesEffected";

            properties.valueTypeName[1] = typeof(float).Name;
            properties.propertyName[1]  = "damageAdditonChange";

            properties.valueTypeName[2] = typeof(float).Name;
            properties.propertyName[2]  = "damageMultiplicationChange";

            properties.valueTypeName[3] = typeof(bool).Name;
            properties.propertyName[3]  = "onlyWorksOnCards";

            properties.valueTypeName[4] = typeof(bool).Name;
            properties.propertyName[4]  = "damageSetTo0";
        }

        properties.value[0] = default(DamageTypes).ToString();
        properties.value[1] = default(float).ToString();
        properties.value[2] = default(float).ToString();
        properties.value[3] = default(bool).ToString();
        properties.value[4] = default(bool).ToString();

        return(properties);
    }
コード例 #2
0
    public override EffectProperties getEffectPropertiesStructure(bool forGUI)
    {
        EffectProperties properties = new EffectProperties(GetType().Name, 4, forGUI);

        if (forGUI)
        {
            properties.valueTypeName[0] = typeof(float).Name;
            properties.propertyName[0]  = "maxDamageInterval_seconds";

            properties.valueTypeName[1] = typeof(float).Name;
            properties.propertyName[1]  = "damageAmount";

            properties.valueTypeName[2] = typeof(DamageTypes).Name;
            properties.propertyName[2]  = "damageType";

            properties.valueTypeName[3] = typeof(int).Name;
            properties.propertyName[3]  = "maxUsesLeft";
        }
        properties.value[0] = default(float).ToString();
        properties.value[1] = default(float).ToString();
        properties.value[2] = default(DamageTypes).ToString();
        properties.value[3] = default(int).ToString();

        return(properties);
    }
コード例 #3
0
 public override void setEffectProperties(EffectProperties properties)
 {
     damageTypesEffected        = (DamageTypes)Enum.Parse(typeof(DamageTypes), properties.value[0]);
     damageAdditonChange        = float.Parse(properties.value[1]);
     damageMultiplicationChange = float.Parse(properties.value[2]);
     onlyWorksOnCards           = bool.Parse(properties.value[3]);
     damageSetTo0 = bool.Parse(properties.value[4]);
 }
コード例 #4
0
    public override void setEffectProperties(EffectProperties properties)
    {
        maxDamageInterval_seconds = float.Parse(properties.value[0]);
        damageAmount = float.Parse(properties.value[1]);
        damageType   = (DamageTypes)Enum.Parse(typeof(DamageTypes), properties.value[2]);
        usesLeft     = int.Parse(properties.value[3]);

        //additional assignments are required for this effect
        timeLeft_seconds = maxDamageInterval_seconds;
    }
コード例 #5
0
    public override bool useCard(Actor cardUser)
    {
        DamageOnContactEffect effect = new DamageOnContactEffect();
        //this is a legacy implementation that should be removed
        EffectProperties properties = effect.getEffectPropertiesStructure(false);

        properties.value[0] = 1f.ToString();
        properties.value[1] = 2f.ToString();
        effect.setEffectProperties(properties);
        cardUser.effects.addEffect(effect);
        return(true);
    }
コード例 #6
0
        void SetVariantProperties(int variant, string keyRight)
        {
            EffectProperties props = properties;

            props.Key                     = keyLeft + keyRight;
            props.ClassicKey              = MakeClassicKey(groupIndex, (byte)variant, family);
            props.GroupName               = HardStrings.itemPowers[groupIndex];
            props.SubGroupName            = HardStrings.extraSpellPtsTimes[variant];
            props.DisplayName             = string.Format("{0} ({1})", props.GroupName, props.SubGroupName);
            props.AllowedCraftingStations = MagicCraftingStations.ItemMaker;

            variantProperties[variant] = props;
        }
コード例 #7
0
    public override EffectProperties getEffectPropertiesStructure(bool forGUI)
    {
        EffectProperties properties = new EffectProperties(GetType().Name, 1, forGUI);

        if (forGUI)
        {
            properties.valueTypeName[0] = typeof(float).Name;
            properties.propertyName[0]  = "increseMultiplyer";
        }
        properties.value[0] = default(float).ToString();

        return(properties);
    }
コード例 #8
0
    private void updatePosibleEffectsList()
    {
        IEnumerable <Effect> possibleEffectEnumerable = ReflectiveEnumerator.GetEnumerableOfType <Effect>(new object[0]);
        int possibleEffectsCount = possibleEffectEnumerable.Count();

        possibleEffectsListNames = new string[possibleEffectsCount];
        possibleEffectsList      = new EffectProperties[possibleEffectsCount];

        int index = 0;

        foreach (Effect effect in possibleEffectEnumerable)
        {
            EffectProperties properties = effect.getEffectPropertiesStructure(false);
            possibleEffectsListNames[index] = properties.effectClassName;
            possibleEffectsList[index++]    = properties;
        }
    }
コード例 #9
0
    /// <summary>
    ///
    /// </summary>
    /// <returns></returns>
    public override EffectProperties getEffectPropertiesStructure(bool forGUI)
    {
        EffectProperties properties = new EffectProperties(GetType().Name, numberOfEffectProperties, forGUI);

        if (forGUI)
        {
            properties.valueTypeName[0] = typeof(float).Name;
            properties.propertyName[0]  = "maxDamageInterval_sec";

            properties.valueTypeName[1] = typeof(float).Name;
            properties.propertyName[1]  = "damageAmount";
        }

        properties.value[0] = default(float).ToString();
        properties.value[1] = default(float).ToString();

        return(properties);
    }
コード例 #10
0
    public void spawnFinishIt()
    {
        string name = player.GetComponent <PlayerController> ().characterName;

        if (name == "Captain Summers")
        {
            finishItEffect = effectManager.SpawnEffect(EffectManager.Effects.smashIt, this.transform, true);
        }
        if (name == "X-42")
        {
            finishItEffect = effectManager.SpawnEffect(EffectManager.Effects.destroyIt, this.transform, true);
        }
        if (name == "The Wonder")
        {
            finishItEffect = effectManager.SpawnEffect(EffectManager.Effects.zapIt, this.transform, true);
        }
        if (name == "Ronin")
        {
            finishItEffect = effectManager.SpawnEffect(EffectManager.Effects.slashIt, this.transform, true);
        }
    }
コード例 #11
0
 public override void setEffectProperties(EffectProperties properties)
 {
     maxDamageInterval_sec = float.Parse(properties.value[0]);
     damageAmount          = float.Parse(properties.value[1]);
 }
コード例 #12
0
        static void ModifyProperty(PersistentEffectEventArgs ea, string propertyPath, string prefix = null, string propertyKey = null, bool logDetails = false)
        {
            if (logDetails)
            {
                Talespire.Log.Debug($"ModifyProperty({propertyPath})");
            }
            if (propertyKey == null)
            {
                propertyKey = propertyPath;
            }

            GameObject childNodeToModify = ea.AttachedNode.GetChildNodeStartingWith(prefix);

            if (childNodeToModify == null)
            {
                Talespire.Log.Error($"childNodeToModify == null");
                childNodeToModify = ea.AttachedNode;
            }
            PropertyModDetails propertyModDetails = BasePropertyChanger.GetPropertyModDetails(childNodeToModify, propertyPath, logDetails);

            if (propertyModDetails == null)
            {
                Talespire.Log.Error($"propertyModDetails == null for property {propertyPath}");
                return;
            }
            if (logDetails)
            {
                Talespire.Log.Debug($"propertyModDetails.GetPropertyType() = {propertyModDetails.GetPropertyType()}");
            }
            BasePropertyChanger propertyChanger = PropertyChangerManager.GetPropertyChanger(propertyModDetails.GetPropertyType());

            if (propertyChanger != null)
            {
                propertyChanger.FullPropertyPath = propertyPath;

                if (ea.PersistentEffect is SuperPersistentEffect superPersistentEffect && prefix != null)
                {
                    if (logDetails)
                    {
                        Talespire.Log.Warning($"prefix = \"{prefix}\"");
                    }

                    string numberStr;
                    if (prefix.StartsWith("0") && prefix.Length > 1)
                    {
                        numberStr = prefix.Remove(0, 1);
                    }
                    else
                    {
                        numberStr = prefix;
                    }

                    if (!int.TryParse(numberStr, out int index))
                    {
                        Talespire.Log.Error($"Unable to parse \"{numberStr}\" into a number.");
                        index = 0;
                    }

                    if (index >= 0 && index < superPersistentEffect.EffectProperties.Count)
                    {
                        EffectProperties effectProperties = superPersistentEffect.EffectProperties[index];
                        ChangeProperty(effectProperties.Properties, propertyKey, propertyPath, propertyModDetails, propertyChanger, logDetails);
                    }
                    else
                    {
                        Talespire.Log.Error($"index ({index}) out of range. Unable to modify property.");
                    }
                }
                else
                {
                    ChangeProperty(ea.PersistentEffect.Properties, propertyKey, propertyPath, propertyModDetails, propertyChanger, logDetails);
                }
            }
コード例 #13
0
 public override void setEffectProperties(EffectProperties properties)
 {
     increseMultiplyer = float.Parse(properties.value[0]);
 }
コード例 #14
0
    /*all properties that are set using the below method should be
     * be defined in a region marked "effect properties" and be
     * defined in the same order as the below methods implement them*/

    /// <summary>
    /// the structure of the struct must be gotten from getEffectPropertiestructer
    /// use the below python script to set the values from the
    /// required variables (reads the clipboard)
    /// does not work for enums, use Variable = (E)Enum.Parse(typeof(E),properties.value[property number]);
    /// </summary>
    /// <param name="properties"></param>
    public abstract void setEffectProperties(EffectProperties properties);