Skip to content

Card Upgrades #244

@patrickwieth

Description

@patrickwieth

For the whole card upgrade fun in the forge (shop), we need new stuff:

We need a key value object with these entries:
The values given are the preset values.

DiscardCost: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 0,
  natureChance: 0,
},
SacrificeCost: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 1,
  natureChance: 1,
},
VoidCost: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 0,
  natureChance: 0,
},
arrival: {
  cost: 3,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 3,
  natureChance: 0,
},
avenge: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 3,
  techChance: 0,
  cultureChance: 1,
  natureChance: 0,
},
battlecry: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
channel: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 3,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
furious: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 1,
  cultureChance: 0,
  natureChance: 3,
},
periodic: {
  cost: 0.8,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
tribute: {
  cost: 0.5},
  picks: 0,
  occurence: 0,
  mythChance: 3,
  techChance: 0,
  cultureChance: 1,
  natureChance: 0,
, 
onConstruction: {
  cost: 0.7,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 3,
  cultureChance: 0,
  natureChance: 0,
},
onDeath: {
  cost: 0.5},
  picks: 0,
  occurence: 0,
  mythChance: 2,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
, 
onSpawn: {
  cost: 0.7,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 2,
  natureChance: 1,
},
pay: {
  cost: 0.7,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 2,
  cultureChance: 1,
  natureChance: 2,
},
loot: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 2,
  natureChance: 0,
},
discardPay: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
dismantle: {
  cost: 0.3,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 3,
  cultureChance: 0,
  natureChance: 0,
},
dissolve: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
spawn: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
beast: {
  cost: 2.2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 0,
  natureChance: 1,
},
bot: {
  cost: 1.5,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 2,
  cultureChance: 0,
  natureChance: 0,
},
powerstone: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 1,
  cultureChance: 0,
  natureChance: 0,
},
recruit: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 1,
  natureChance: 0,
},
spirit: {
  cost: 1.1,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
avatar: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 5,
  techChance: 5,
  cultureChance: 5,
  natureChance: 5,
},
anthem: {
  cost: 2},
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 3,
  natureChance: 1,
, 
arm: {
  cost: 1},
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 2,
  cultureChance: 3,
  natureChance: 2,
, 
armor: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 3,
  cultureChance: 2,
  natureChance: 2,
},
heal: {
  cost: 0.8,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 0,
  natureChance: 3,
},
strengthen: {
  cost: 0.7,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 2,
  natureChance: 3,
},
train: {
  cost: 0.9,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 2,
  natureChance: 1,
},
fortify: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 3,
  cultureChance: 1,
  natureChance: 2,
},
repair: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 3,
  cultureChance: 1,
  natureChance: 0,
},
bounce: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 2,
  cultureChance: 0,
  natureChance: 0,
},
kill: {
  cost: 3,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
reassemble: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 2,
  cultureChance: 0,
  natureChance: 0,
},
resurrect: {
  cost: 3,
  picks: 0,
  occurence: 0,
  mythChance: 3,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
burn: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 2,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
harm: {
  cost: 1},
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
, 
grind: {
  cost: -0.75,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 3,
  cultureChance: 1,
  natureChance: 1,
},
suffer: {
  cost: -0.75,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 3,
},
choose: {
  cost: 0,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
count: {
  cost: 1.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
countDust: {
  cost: 1.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
countPower: {
  cost: 1.5,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 0,
  natureChance: 1,
},
discard: {
  cost: -0.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
sacrifice: {
  cost: -1,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 1,
  natureChance: 0,
},
void: {
  cost: -0.3,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
discountAction: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
discountEntity: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 1,
  natureChance: 0,
},
discountPlace: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 1,
  cultureChance: 0,
  natureChance: 0,
},
produce: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
drawAction: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
drawEntity: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 1,
  natureChance: 1,
},
drawPlace: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 1,
  cultureChance: 0,
  natureChance: 0,
},
recoverAction: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
recoverEntity: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 1,
  natureChance: 1,
},
recoverPlace: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 1,
  cultureChance: 0,
  natureChance: 0,
},
enrage: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 1,
  cultureChance: 0,
  natureChance: 3,
},
hasten: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 3,
  natureChance: 1,
},
grow: {
  cost: 0.25,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 3,
  natureChance: 1,
},
insight: {
  cost: 0.25,
  picks: 0,
  occurence: 0,
  mythChance: 5,
  techChance: 3,
  cultureChance: 3,
  natureChance: 3,
},
laneswap: {
  cost: 1},
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 1,
  natureChance: 0,
}, 
mill: {
  cost: 0.3},
  picks: 0,
  occurence: 0,
  mythChance: 2,
  techChance: 1,
  cultureChance: 0,
  natureChance: 1,
}, 
silence: {
  cost: 1.5,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
withdraw: {
  cost: 0.2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 3,
  natureChance: 0,
},
countpowerscale: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 0,
  natureChance: 1,
},
stimpack: {
  cost: 0.5,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 0,
  natureChance: 1,
},
salvage: {
  cost: 0.75,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 1,
  cultureChance: 0,
  natureChance: 0,
},
autopsy: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
corpseexplosion: {
  cost: 3,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
scraprepair: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 1,
  cultureChance: 0,
  natureChance: 0,
},
tribe: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 1,
  techChance: 1,
  cultureChance: 1,
  natureChance: 1,
},
ManaRatio: {
  cost: 2,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
},
UpgradeBuff: {
  cost: 1,
  picks: 0,
  occurence: 0,
  mythChance: 0,
  techChance: 0,
  cultureChance: 0,
  natureChance: 0,
}

Let's call this KV Store UpgradeFactors.
There are 2 special numbers, these do not reflect real keywords but rather global parameters (ManaRatio, UpgradeBuff), for us in the blockchain this is not really relevant.

For queries we need:
QueryUpgradeFactors this returns the UpgradeFactors KV array

for TX we need:
ReportUpgradePicks this can only be done by a MatchReporter. This tx gets an array of the structure:

{ 
  picked: ["upgradeKey1", "upgradeKey2", ... ]
  dismissed: ["upgradeKey1", "upgradeKey2", ... ]
}

When this transaction is handled,

for each upgradeKeyN in dismissed
    upgradePicks[upgradeKeyN]--

for each upgradeKeyN in picked
    upgradePicks[upgradeKeyN] += 1*length(dismissed)/length(picked)

SetUpgradeFactors this tx can hard update all values of the KV store by giving an appropriate data array. This is mostly for us being able to update the chances.

We also have to update the weekly update function. How this is done, I will write in the next post.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions