Ejemplo n.º 1
0
 public float ActivityCostModifier(string activityName)
 {
     if (ActivityCostModifiers.ContainsKey(activityName))
         return 1 + ActivityCostModifiers[activityName];
     else
         return 1;
 }
Ejemplo n.º 2
0
 public float ActivityCostModifier(string activityName)
 {
     if (ActivityCostModifiers.ContainsKey(activityName))
     {
         return(1 + ActivityCostModifiers[activityName]);
     }
     else
     {
         return(1);
     }
 }
Ejemplo n.º 3
0
    public void Reset()
    {
        NoLevelRestrictions = false;

        ActivityLocks.Clear();
        FreeActivities.Clear();
        ActivityCostModifiers.Clear();
        ProvisionCostModifiers.Clear();
        ProvisionAmountModifiers.Clear();
        UpgradeTagCostModifiers.Clear();
        FreeUpgradeTags.Clear();

        EventData.Clear();
    }
Ejemplo n.º 4
0
    public void Read(BinaryReader br)
    {
        NoLevelRestrictions = br.ReadBoolean();

        int dictionaryCount = br.ReadInt32();

        for (int i = 0; i < dictionaryCount; i++)
        {
            ActivityLocks.Add(br.ReadString(), br.ReadBoolean());
        }

        dictionaryCount = br.ReadInt32();
        for (int i = 0; i < dictionaryCount; i++)
        {
            FreeActivities.Add(br.ReadString(), br.ReadBoolean());
        }

        dictionaryCount = br.ReadInt32();
        for (int i = 0; i < dictionaryCount; i++)
        {
            ActivityCostModifiers.Add(br.ReadString(), br.ReadSingle());
        }

        dictionaryCount = br.ReadInt32();
        for (int i = 0; i < dictionaryCount; i++)
        {
            ProvisionCostModifiers.Add(br.ReadString(), br.ReadSingle());
        }

        dictionaryCount = br.ReadInt32();
        for (int i = 0; i < dictionaryCount; i++)
        {
            ProvisionAmountModifiers.Add(br.ReadString(), br.ReadSingle());
        }

        dictionaryCount = br.ReadInt32();
        for (int i = 0; i < dictionaryCount; i++)
        {
            UpgradeTagCostModifiers.Add(br.ReadString(), br.ReadSingle());
        }

        dictionaryCount = br.ReadInt32();
        for (int i = 0; i < dictionaryCount; i++)
        {
            FreeUpgradeTags.Add(br.ReadString(), br.ReadInt32());
        }
    }
Ejemplo n.º 5
0
    public void IncludeEvent(TownEvent townEvent)
    {
        for (int i = 0; i < townEvent.Data.Count; i++)
        {
            EventData.AddRange(townEvent.Data);

            switch (townEvent.Data[i].Type)
            {
            case TownEventDataType.ActivityCostChange:
                if (!ActivityCostModifiers.ContainsKey(townEvent.Data[i].StringData))
                {
                    ActivityCostModifiers.Add(townEvent.Data[i].StringData, 0);
                }

                ActivityCostModifiers[townEvent.Data[i].StringData] += townEvent.Data[i].NumberData;
                break;

            case TownEventDataType.ActivityLock:
                if (!ActivityLocks.ContainsKey(townEvent.Data[i].StringData))
                {
                    ActivityLocks.Add(townEvent.Data[i].StringData, true);
                }
                break;

            case TownEventDataType.FreeActivity:
                if (!FreeActivities.ContainsKey(townEvent.Data[i].StringData))
                {
                    FreeActivities.Add(townEvent.Data[i].StringData, true);
                }
                break;

            case TownEventDataType.NoLevelRestriction:
                NoLevelRestrictions = true;
                break;

            case TownEventDataType.ProvisionTypeAmountChange:
                if (!ProvisionAmountModifiers.ContainsKey(townEvent.Data[i].StringData))
                {
                    ProvisionAmountModifiers.Add(townEvent.Data[i].StringData, 0);
                }

                ProvisionAmountModifiers[townEvent.Data[i].StringData] += townEvent.Data[i].NumberData;
                break;

            case TownEventDataType.ProvisionTypeCostChange:
                if (!ProvisionCostModifiers.ContainsKey(townEvent.Data[i].StringData))
                {
                    ProvisionCostModifiers.Add(townEvent.Data[i].StringData, 0);
                }

                ProvisionCostModifiers[townEvent.Data[i].StringData] += townEvent.Data[i].NumberData;
                break;

            case TownEventDataType.UpgradeTagDiscount:
                if (!UpgradeTagCostModifiers.ContainsKey(townEvent.Data[i].StringData))
                {
                    UpgradeTagCostModifiers.Add(townEvent.Data[i].StringData, 0);
                }

                UpgradeTagCostModifiers[townEvent.Data[i].StringData] += townEvent.Data[i].NumberData;
                break;

            case TownEventDataType.UpgradeTagFree:
                if (!FreeUpgradeTags.ContainsKey(townEvent.Data[i].StringData))
                {
                    FreeUpgradeTags.Add(townEvent.Data[i].StringData, 0);
                }

                FreeUpgradeTags[townEvent.Data[i].StringData] += (int)townEvent.Data[i].NumberData;
                break;

            case TownEventDataType.BonusRecruit:
                DarkestDungeonManager.Campaign.Estate.RestockBonus(townEvent.Data[i].StringData,
                                                                   (int)townEvent.Data[i].NumberData);
                break;

            case TownEventDataType.DeadRecruit:
                DarkestDungeonManager.Campaign.Estate.RestockFromGrave((int)townEvent.Data[i].NumberData);
                break;

            default:
                break;
            }
        }
    }