Closed ClaudeZsb closed 10 months ago
Given an array of heroes, we can simply sum all Creature.race
together. Then what we got is a uint32 number that could be split into 8 parts of length 4 bits. Each part denotes the number of heroes of the specific race. Since we have the hero number for each race, we could search maybe from a table named by RacialEffect
whether there is an available racial effect.
racial effect
What we want to have is that when a player has a certain number of heroes of the same race, it will give a specific effect to all his heroes. And this mechanism can give birth to a variety of hero combinations.
race representation
race
is an uint32 and is composited by 8 numbers of length 4 bits. Each number of length 4 bits represents one race and its position withinrace
is fixed.race_*
=0000
or0001
.0001
represents this creature belongs torace_*