Add AdventureBot combat reactions, training and corpse recovery
GCC PCH / build (push) Canceled after 0s
clang PCH / build (push) Canceled after 0s

This commit is contained in:
Nico committed 2026-10-27 23:17:05 +01:00
1 parent e18a416bf4
commit c0c799c4b6
37 files changed
+1568 -18

No files matched your search

@@ -6,10 +6,11 @@
namespace AdventureEconomyPolicy
{
enum class Service { None, Vendor, Bank, Auction, Any };
enum class Service { None, Vendor, Bank, Auction, Repair, Any };
inline Service RequiredService(std::string const& kind)
{
if (kind=="vendor_visit" || kind=="goods" || kind=="trade" || kind=="vendor_compare") return Service::Vendor;
if (kind=="repair") return Service::Repair;
if (kind=="bank_visit" || kind=="banking") return Service::Bank;
if (kind=="auction_visit" || kind=="auctions") return Service::Auction;
if (kind=="service_wait" || kind=="service_finish") return Service::Any;
@@ -26,14 +27,15 @@ inline bool Economic(std::string const& kind)
{
return RequiredService(kind)!=Service::None || kind=="supplies";
}
inline bool Matches(std::string const& kind, bool vendor, bool banker, bool auctioneer)
inline bool Matches(std::string const& kind, bool vendor, bool banker, bool auctioneer, bool repairer=false)
{
switch (RequiredService(kind))
{
case Service::Vendor: return vendor;
case Service::Bank: return banker;
case Service::Auction: return auctioneer;
case Service::Any: return vendor || banker || auctioneer;
case Service::Repair: return repairer;
case Service::Any: return vendor || banker || auctioneer || repairer;
default: return false;
}
}