ratenbuuren / ProjectBeard

Best Game EVAH!
https://gamejolt.com/games/Project_Beard_Rebirth/277210
MIT License
1 stars 0 forks source link

Add ammo types #49

Closed kdhageman closed 7 years ago

kdhageman commented 7 years ago

Fixes #31

Changes

Normal ammo

Regular bullets, nothing fancy projectbeard_normal

Armor piercing ammo

Similar to normal ammo, but bypasses armor projectbeard_piercing

Explosive ammo

Creates an explosion when hitting something. The explosion deals damage to ANY tank it hits, including the tank that fired the bullet. Create explosion on hit Scale explosion size with tank stats. projectbeard_explosion

Projectiles collision

Projectiles now collide with the edge of the terrain and with the obstacles. projectbeard_collision

Damage system

                                                      +------------------+
                                                      |      Normal      |
                                                      |                  |
                                                 +--> |   = mult * 1     |
                                                 |    |                  |
                                                 |    +------------------+
                                                 |
+-------------+       +----------------------+   |    +------------------+
|             |       |                      |   |    |  Armor Piercing  |
|  TankStats  |       | ProjectileController |   |    |                  |
|  (Damage)   +-----> |    (Multiplier)      +------> |   = mult * 0.9   |
|             |       |                      |   |    |                  |
+-------------+       +----------------------+   |    +------------------+
                                                 |
                                                 |    +------------------+
                                                 |    |    Explosive     |
                                                 |    |                  |
                                                 +--> |   = mult * 0.75  |
                                                      |                  |
                                                      +------------------+

The TankStats has already defined a projectile damage value. This value is used by the ProjectileController as a base damage value. ProjectileController adds a DamageMultiplier value, which is used in combination with the base damage to compute the actual damage

base damage * damage multiplier = actual damage

With the image above in mind, an example; a tank with base damage of 10 and explosive ammo, will hit the enemy for 10 * 0.75 = 7.5 damage.

ratenbuuren commented 7 years ago

Had a quick play-through just now. Works as intended, one nice addition:

kdhageman commented 7 years ago

@ratenbuuren Good idea to add ammo type to the UI. It's outside of the scope of this PR, so I'll add a new issue.