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)); }
private string BuildRequirements(SCLogicRewardSource r) { var rule = GetRule(r); var result = string.Join(" OR ", rule.Select(inner => "(" + string.Join(" AND ", inner) + ")")); return(result); }
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(); }
private List <List <string> > GetRule(SCLogicRewardSource r) { return(r.Requirements.Select(l => GetRule(l)).ToList()); }