Shields - need some balance suggestions! (PRed)

I’m planning to add shields to the game. I have the jsons for items set up and that’s about it. So far, the way I think they should work is:

-Different types of shields (as opposed to a generic shield item); the main trade-off is between encumbrance and protection. A huge shield is going to slow you to a crawl but block almost anything you point it at. So far I’m planning to add: two-by-shield (craftable after low fabrication skill is reached), leather buckler (requires both fabrication and tailoring as well as, obviously, leather), riot shield (probably found in police stations or barricades), ballistic shield (barricades or labs?), scutum/tower shield (recipe should only be found in that one armormaking book).
-Allow the shield to be ‘readied’ - the wielder holds it up in front of themselves instead of leaving it on their arm, preventing them from attacking but increasing chance to block (detailed below).
-Some larger shields (scutum?) can be planted into the ground as stationary cover.

-Shields do not naturally provide protection to arms/hands; the attack code itself should handle this. Presence of a shield is factored in whenever an enemy attempts a ranged or melee attack. (Special attacks like lightning can probably get through.) This code takes effect just before the armor blocking code.
-Check for ranged:
What’s the projectile’s stats? If an NPC is throwing rocks at you they’ll be stopped without a problem. If they’re shooting arrows at you, however, then your puny two-by-shield probably isn’t going to cut it - a crude, thin wooden shield isn’t durable enough to stop an arrow and you’d need crazy reflexes to position it in time. Only ballistic shields (found in labs or police barricades?) can stop bullets, and nothing’s going to stop a grenade or missile.
If the shield is small, how good are the wielder’s reflexes (dodge skill or dexterity)? They need to have the shield in position. Bonuses are given for the shield being readied and the shield’s relative size to the wielder (coverage).
If the block is successful, check dexterity (or melee?) again. Taking a hit dead-on might reduce the shield’s durability; simply pushing the projectile to one side won’t.
-Check for melee:
Melee attacks are a little more complicated. First, compare the dexterity of both parties - if the enemy is considerably faster, they’ll be able to get around a shield easily; if the player is faster, they can knock most attacks aside.
If the attack hits the shield, compare strength. The shield might be knocked away - certain enemies (grabber zombies!) might specifically yank on the shield and receive a bonus to this. (If the player insists on holding onto the shield in this situation, they might possibly be knocked over!)
Dexterity/melee should be checked again if the block is successful - same direct hit vs. roll off situation as in ranged.
-Similarly to blocking, the player can only block one enemy (but multiple attacks from said enemy) per turn with a shield unless they have crazy high dexterity/dodge.

I haven’t added many items so I’m not that experienced in balancing things. I’ll look at the actual numbers when I submit this to github - right now, I’m worried about the balance of the concepts above. Suggestions?

Pull requested with a [WIP] tag; suggestions on github are also welcome (information there is likely more up-to-date).

You should also check the “handedness” of wielded weapon (like with fussion-cannon-arm) - you cannot wield two-haded weapon with shield after all.

There isn’t a “TWO-HANDED” flag for items and I don’t exactly feel like going through every single item in the game and adding it. Just did some quick testing - the fusion blaster doesn’t actually prevent you from holding big, typically two-handed things like the zweihänder. Must not be implemented yet. Still, that’s a good idea and I was going to try adding it until I realized the above.

You haven’t said anything about encumbrance, I somewhat assume some amount of arm encumbrance for wearing the shield?
I could see some very small shields being effectively free, as in having no penalty as long as they’re wielded opposite a suitably small weapon.

I’m not sure about readying a shield preventing attacks, outside of planting a shield between you and a ranged enemy and waiting for it to run out of ammo, I don’t see how it would be useful.

It seems like the shield would tie into the existing blocking code, providing a large bonus compared to other blocking weapons.

Yes, there’s definitely going to be arm encumbrance. Sticking a gigantic plank to your arm isn’t going to make swinging a melee weapon EASIER, is it?

The main idea behind readying a shield is it trades a large amount of offense for a large amount of defense. You can also still move (albeit maybe more slowly), allowing you to advance on a ranged enemy or possible source of shrapnel relatively safely. If you manage to get your hands on a ballistic shield, you could potentially use this strategy to get right up in a turret/NPC’s face and get a few extra melee attacks in before it shoots you to death. (or if it’s a turret, simply push it over :P)
Yeah, using it to make an enemy expend all their ammo is a good idea too; I just didn’t realize that was a valid strategy.

IIRC, the blocking code only reduces damage. If your shield gets hit by an arrow (and the arrow doesn’t penetrate or break it), the arrow doesn’t damage your arm - the blocking code, as it is, would exhibit this effect. Also, despite being strapped to only one body part and thus encumbering only that body part, it can still protect the entire body, so it can’t be implemented as only item properties. Smaller shields (the buckler and two-by-shield) might be able to act as a supplement to a blocking weapon and thus be added to the blocking code, but larger shields (riot, ballistic, ESPECIALLY the scutum) would behave differently due to their size. Blocking also has that number-of-blocks-per-turn limit; since you can only protect in one direction at a time with a shield - as opposed to every direction with armor - the limit needs to behave differently for shields and fail based on number of separate enemies/directions for taking damage instead. Or maybe the first attack by an enemy in a turn could set a ‘direction’ for the shield; after this, it can only block attacks within a certain angle of that direction, determined by dexterity/strength (which would determine ability to swing the shield around swiftly and to the right location) and shield size? Finally, that disarming part needs to be implemented too - some enemies, namely NPCs and grabbers, can probably figure out that there’s a shield in between them and you that they need to get rid of.

I’ll just implement the smaller shields for now because I actually don’t feel very confident in adding an entirely new section to the combat code - maybe with more experience in C++, and maybe once the idea’s a little more fleshed out.

That can get very silly very fast: suppose you have z-child on one side and z-hulk on the other - and z-child strikes you first.

It sounds less like shields should be their own thing and more like the blocking code should be extended to support the shields.
I don’t think it’s any more practical to block 4 attacks from 4 directions in a given time period with a sword than it is to do so with a shield. Limb blocking is a bit different since you can block with multiple limbs.

If anything I’d think a shield would be a bit easier since you don’t have to specifically block, just interpose the shield.

Yeah, I thought you were talking about armor blocking code; I wasn’t aware that you could block with a weapon at all until I found the function. Seems like a good option, but I still want to extend it with the place/ready options and being disarmable.
On that topic - is enemies being able to disarm the player actually planned/a good idea?

EDIT: Okay, currently editing the block code. Is there any particular reason why block_bonus is initialized as 2?

Also, I’m implementing ‘readying’ as a defensive stance - the character holds their shield in their hand instead of wearing it on their arm (if applicable) and tries to keep it between a majority of their body and possible damage sources at any cost. Attacking can still be performed, but will take a lot longer or deal less damage (since they don’t have their weapon held ready). Code-wise, this doubles the block bonus from the shield and will probably decrease move/attack speed. Should I require a fighting style for this to be used? Also, what menu could I add the action to?

Hey, gang, W_BLOCK3 is a weapon flag and currently only exists to support players holding a sewer cover between xemself and the attack.

Using existing but underutilized code is Nifty. :wink:

[quote=“KA101, post:9, topic:8668”]Hey, gang, W_BLOCK3 is a weapon flag and currently only exists to support players holding a sewer cover between xemself and the attack.

Using existing but underutilized code is Nifty. ;-)[/quote]
Actually, it’s not utilized at all - I checked the manhole cover item after I saw you mention it in another post and it doesn’t have a W_BLOCK3 tag anywhere on it.

Anyways, these are shields that are normally strapped to an arm instead of held as a primary weapon! They should provide a bonus to existing block instead of acting as the only source. The only way to properly implement the W_BLOCK3 flag like this would be to add dual-wielding to the game, and I’m afraid of adding such massive changes by myself <:( This would also prevent different shields from having different bonuses to block, which would be caused by size/material.
I’m submitting the PR as WIP/CR, though - this is a pretty big addition tactics-wise and there’s a lot I’m not entirely sure how to add - so feel free to check it on github and make sure I’m not missing out on any niftiness.

No and no. The only way to lose your weapon is through your own actions of getting it stuck in an enemy, and there are no plans to change that.

Shields don’t work like that, you’re either wearing them or not wearing them, it’s based on the design of the shield whether it’s held or not. A stance could have you more actively using it, but the only option for it not taking up the hand in the current system is to un-wear it.
quote author=ThinkInvisible link=topic=9310.msg212039#msg212039 date=1421625312]
…and tries to keep it between a majority of their body and possible damage sources at any cost. Attacking can still be performed, but will take a lot longer or deal less damage (since they don’t have their weapon held ready). Code-wise, this doubles the block bonus from the shield and will probably decrease move/attack speed. Should I require a fighting style for this to be used? Also, what menu could I add the action to?
[/quote]
Any particular reason you aren’t just increasing the encumbrance penalty on the arms when you’re actively blocking?
Menu-wise, you might want to 'a’ctivate the shield to toggle the blocking mode.

On enemies being able to do things to your weapon: a friend of mine said she managed to get her weapon broken by a shocker brute when it slammed her. My best guess is that her character probably parried the slam and that’s what resulted in the weapon breaking, but still, weapon breakage is another thing that can happen.

Yeah, little moment of stupidity there :stuck_out_tongue: If you haven’t noticed, I tend to get a little incoherent while brainstorming.

I never really looked into exactly what encumbrance was - just associated it with bad things like missing melee attacks and tried to avoid it while playing. Guess I could do that, then.

About disarming - since people won’t exactly be attacking with their shield and thus probably won’t get it stuck in an enemy, I was considering making ‘intelligent’ enemies able to knock shields aside. That’s what I was asking about, specifically; would this be a bad thing?

EDIT: Well, darn. Git submitted master (without any local changes) when I used git commit ./git push, and then erased all my local changes. I suppose there’s no way to get code back from .o files? Never mind, just moved them all back to master or some such nonsense.