コード例 #1
0
 private bool IsLocationIncentivized(SCLogicRewardSource r)
 {
     if (r.RewardSource is ItemShopSlot && incentivesData.IncentiveLocations.Contains(ItemLocations.CaravanItemShop1))
     {
         return(true);
     }
     return(incentivesData.IncentiveLocations.Any(i => i.Address == r.RewardSource.Address));
 }
コード例 #2
0
        private string BuildRequirements(SCLogicRewardSource r)
        {
            var rule = GetRule(r);

            var result = string.Join(" OR ", rule.Select(inner => "(" + string.Join(" AND ", inner) + ")"));

            return(result);
        }
コード例 #3
0
        private int GetLocationId(SCLogicRewardSource r)
        {
            if (r.RewardSource is TreasureChest)
            {
                return(r.RewardSource.Address - 0x3100 + ChestOffset);
            }
            else if (r.RewardSource is MapObject npc)
            {
                return((int)npc.ObjectId + NpcOffset);
            }
            else if (r.RewardSource is ItemShopSlot shop)
            {
                return(0x2FF);
            }

            throw new NotSupportedException();
        }
コード例 #4
0
 private List <List <string> > GetRule(SCLogicRewardSource r)
 {
     return(r.Requirements.Select(l => GetRule(l)).ToList());
 }