Bewitchment (Legacy)

Bewitchment (Legacy)

8M Downloads

Vampire stuff

Sunconure11 opened this issue ยท 9 comments

commented

While vampirism is mostly complete, there is no valid way of becoming one, and it is lacking in unique content.

  • One or more kinds of vampiric minion, created via spellcasting
  • Coffins
  • Wooden stakes, for vampire hunters
  • Silver and garlic-tipped silver arrows, also for vampire hunters. Silver arrows also work on werewolves, and an aconite-tipped variant damages werewolves more.
  • Blood bottles
  • More vampiric rituals
  • A way of becoming a vampire
  • Some other stuff, will expand later
commented

Wouldn't the prime vampire be the result of pissing off a gypsy or making some sort of demonic pact?

commented

Uh, excuse me?

commented

Just ideas of how you become a vampire. The gypsy thing was more of a joke...unless you want to add a new villager.

commented

My vote for how to become a vampire is either a pact with a demon such as Lilith, or encountering a vampire using the crystal ball, and being bitten.

commented

// TODO Check: can two different living hurt events run down the subscriber list in parallel?
// If so this doesn't work and one entity might end up receiving the damage amount meant for someone else in some cases
public static float lastDamage = 0;

Someone more experienced than I should take a look to confirm this, but I think there is a potential problem here. If a LivingHurtEvent handler posts another LivingHurtEvent in between setting and getting the lastDamage variable, it will overwrite the value. For example, I've seen potion effects that cause a target to damage all entities in an AOE when they take damage. A vampire under this effect would calculate their final damage from an attack using the AOE base damage.

Other than that, it should work. The event bus doesn't have a queue, so it just iterates through all applicable listeners in order when an event is posted.

commented

Yeah, it's correct. I was pretty sure there was this problem when I created this code. It will need a capability to store the intended damage on a per entity basis. This is still problematic in case something deals damage to the same entity twice in a row, as the damage will be set to the one of the inner most instance. A per entity stack of damage values might be needed

commented

What if lastDamage values are stored in a stack? If a new event is posted while resolving the attack, it will push a new value, handle it, and pop it off, leaving the desired value untouched

commented

Yes, that was exactly my suggestion. A per-entity stack. Dividing it per entity helps with debugging, and makes the whole thing more object oriented

commented

Vampires are planned in the update after the diabolic update. However, some code that exists relating to them has been causing issues here and there. Regardless, this issue will be closed until then.