commonnsa.blogg.se

Caves of qud how to attack
Caves of qud how to attack










caves of qud how to attack caves of qud how to attack

I'm basically trying to create a sort of API that'll allow me to easily inherit from a base weapon class and add additional behaviors somehow. Here's a couple unique weapon ideas I have:Įxplosion sword: Create explosion in attack direction.Ĭold sword: Chance to freeze enemies when they are hit.Įlectric sword: On attack, electricity chains damage to nearby enemies. I was thinking of using interfaces to allow for the implementation of whatever "event" is needed (such as having an interface for OnPlayerAttack(), which would force the creation of a method that is called whenever the player attacks something). This does not feel very efficient or clean at all. This would involve creating a sub-class for every weapon type and overriding each method to make sure the behavior works appropriately. My current idea is to make a base abstract weapon class, and then have calls to all the methods when appropriate in there (OnPlayerHit() would be called whenever the player's health is subtracted from, for example). The issue is, I've never actually made a system as flexible as this. I want to essentially create a sort of API that is called when appropriate and gives whatever information is necessary (For example, I could opt to use methods called OnPlayerHit() or IfPlayerBleeding() to implement behavior for each weapon). I am, however, having a problem with coming up with a flexible and dynamic system to allow me to quickly create unique effects for the weapons. Getting basic weapon stats like power, weight, and range is not a problem. So I'm currently working on a rogue-like top-down game that features melee combat.












Caves of qud how to attack