Commit Graph
253 Commits
Author SHA1 Message Date
Sevenfm b6f15b2347 Add robots to enemy groups (by rftr).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8956 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-04-03 03:32:40 +00:00
Sevenfm d66a05b0f4 NO_STANDING_ANIM_ADJUSTMENT_IN_COMBAT: apply only for player mercs, to avoid possible problems with AI.
CalcChanceHTH: only use reduced chance for boxers.
AIDoctorFriend, AIDoctorSelf: first change soldier to stationary.
AIDoctorFriend: change target to stationary.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8928 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-08 18:27:27 +00:00
Sevenfm 6ad8b22368 CalcChanceHTH: restored higher base chance for melee attacks.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8927 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-02-07 21:07:17 +00:00
Sevenfm 32e8f9d4ff EstimatePathCostToLocation: safety checks.
Main Red AI: fixed decision weight calculation.
Player mercs should avoid moving into gas/fire when in autobandage mode or under AI control.
IsLocationSittable, IsLocationSittableExcludingPeople: return FALSE if location on roof does not exist.
NWSS: play room effect for first shot only.
AI inventory choosing: more variety for mortar shells, improved hand/GL grenade choosing code.
Red AI: improved mortar use code: use next action to fire mortar after stepping back.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8920 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-01-14 15:45:11 +00:00
Sevenfm dd9c6b1f3e ArtilleryStrike: supply GetArtilleryLaunchParams with launcher item and not just mortar shell, as it will check it's range later.
Add smoke after explosion: improved code.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8913 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-10-30 17:55:11 +00:00
Sevenfm 6194bbdbd8 Hopefully improved r8658:
- check weapon magazine size and chance to say phrase when using gun
- always reset fSayAmmoQuotePending in InternalReduceAttackBusyCount()

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8894 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-09-28 04:41:15 +00:00
Sevenfm 5903abee09 Various AI improvements.
FindThrowableGrenade: allows to specify type and damage of searched grenade.
New counter SOLDIER_COUNTER_RETREAT allows to set number of turns which soldier will try to retreat and take cover.
FindBestNearbyCover: use PrepareThreatlist as unified function to make list of all known opponents.

Militia Control:
- start retreating mode for 2 turns when ordering retreat
- replace AI_ACTION_RUN_AWAY with AI_ACTION_TAKE_COVER order so that militia do not retreat from sector

New AI behavior:
- soldier can use smoke grenade to cover himself when under fire
- soldier can use use smoke grenade on his friend to cover him
- if soldier used smoke, he starts retreat mode for 2 turns
- added retreat code to Red, Black AI
- improved Main Red AI for civilians (they only run away)

Improved suppression code:
- less chance of suppression when opponent has high shock level
- prefer using suppression fire when soldier is in cover

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8879 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-08-07 12:12:31 +00:00
Sevenfm e9107eab34 CalcChanceHTH:
- slightly lowered base chance
- reduce chance if defender is blind
- reduce chance if attacker is blind
- bonus for boxers for attacking from the back

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8877 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-08-02 16:55:46 +00:00
Sevenfm e959d6893b Added new soldier flags: SOLDIER_BACK_ATTACK, SOLDIER_SNEAK_ATTACK (work for punch and stab attacks only).
ClosestKnownOpponent() now can return ID of closest opponent.
CalcCoverValue: improved code to avoid friendly fire.
EVENT_SoldierBeginPunchAttack: use supplied gridno as sTargetGridNo may not be set yet

Boxing:
- added possibility of counterattack after failed attack
- added possibility of opportunity attack a passing enemy
- bonus in CTH for boxers for attack from the back

Boxing AI:
- for boxers, always use high morale so that they attack
- cautious boxer approach, reserve AP for two attacks (only if not attacking from the back)
- try to avoid frontal attack
- sometimes boxer may decide to restore breath instead of moving and attacking
- boxer can step back to move away from opponent, if he is low on breath
- improved main boxer AI

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8876 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-08-02 16:35:10 +00:00
Sevenfm d9c8a1c398 New tag <shotAnimation> in AmmoTypes.xml allows defining custom shot animation.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8800 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-05-13 06:31:11 +00:00
Sevenfm 7f8fc44a7d Improved code to update scope mode when changing stance.
ChangeScopeMode: use NOWHERE instead of 0 as incorrect target gridno.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8796 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-30 00:48:52 +00:00
Sevenfm 4e34605f86 Red, Black AI: try to use sidearm if not enough AP to shoot with main weapon.
Black AI: improved check to avoid friendly fire.
FindAIUsableObjClass: by default search for weapon with longest range, if fSidearm = TRUE search for fastest weapon.
AICalcChanceToHitGun: if AI_EXTRA_SUPPRESSION = TRUE, always return min 1% for AI.
RangeChangeDesire:
- civilians only want to run away
- added small bonus to range change desire if soldier has no gun or short range weapon
CalcBestShot, CheckIfShotPossible: always check if can shoot at target seen by another soldier.
CalcBestShot, CalcBestThrow, CalcBestStab: initialize attack data.
Removed obsolete code.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8782 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-08 21:24:56 +00:00
Sevenfm 5350258334 Added "WIP" description to LOBOT ingame option.
Fixed Polish localized string for LOBOT option.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8781 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-08 11:10:58 +00:00
Sevenfm 306eca7dfc New option NWSS enables New Weapon Sound System.
Increased SOUND_MAX_CHANNELS to 128 for NWSS to work correctly.
New tag in AmmoStrings.xml: <NWSSCaliber>
New tags in Weapons.xml: <ubNWSSCase>, <ubNWSSLast>, <szNWSSSound>
Fixed some warnings.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8780 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-04-05 23:58:07 +00:00
Sevenfm 560219ac36 Fixed delayed mode for grenades.
Changing delayed mode for grenade launcher only possible with DELAYED_GRENADE_EXPLOSION = FALSE.
Minor code improvements and warning fixes.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8771 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-03-14 10:39:18 +00:00
Sevenfm a6271e2e47 ExpAffect: don't spread fire on water.
StructureHit: check water level.
Only normal, stun and flashbang explosives create water explosion.
Increase max force when throwing items into water (to compensate for no bouncing).
Increased splash volume from LOWVOLUME to MIDVOLUME.
InternalIgniteExplosion: no fragments in water.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8752 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-02-13 15:57:10 +00:00
Sevenfm 74443ca8a9 New option TAUNT_VOICE (FALSE by default): if true, will play sound file instead of showing text.
New option TAUNT_VOICE_SHOW_INFO (FALSE by default): if true, will show debug info when playing voice taunt.
Restored JA2TESTVERSION for SpreadPatternLog.txt
Allow taunts from militia when using voice taunts.
Don't show noise text messages from militia (if on our side).
Fixed incorrect OKLIFE check in CheckStatusNearbyFriendlies().

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8743 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-02-07 10:13:16 +00:00
Sevenfm f54a91718b Play grenade pin sound (supports custom grenade pin sound with <sSound> tag in Weapons.xml)
Help AI associate noise with enemy presence: 
- melee attack noise type changed to NOISE_BULLET_IMPACT
- HTH attack noise type changed to NOISE_BULLET_IMPACT
- grenade pin noise type changed to NOISE_GRENADE_IMPACT
- launcher attack noise type changed to NOISE_GUNFIRE

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8728 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-01-11 17:15:17 +00:00
Sevenfm 0e8c086a9a NCTH: improved laser bonus code.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8716 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-12-05 08:48:26 +00:00
Flugente 8b698f0633 Fix: inventory button to change firemodes was greyed out for guns with one base fire mode, even if it had several barrel configurations
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8701 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-10-23 22:07:58 +00:00
Sevenfm 7342e39858 Fixed incorrect attacker's extra strength calculation in CalcChanceHTH()
Fix: don't allow opening inventory panel if soldier is not available during interrupt.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8691 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-08-23 20:23:44 +00:00
Flugente de8bf8a7d6 Armour and its attachements can now alter the fire damage received by setting a value in the <sFireResistance>-tag. This is affected by item status.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8664 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-02-10 20:42:39 +00:00
Flugente e7f098c2f2 If DELAYED_GRENADE_EXPLOSION = TRUE in JA2_Options.ini, toggling fire modes on a grenade launcher toggles whether the grenades explode on impact or with a 1-turn delay.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8653 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-01-27 23:53:11 +00:00
Flugente a5e5ff6bd8 The new <BarrelConfiguration>-tag specifies how many bullets a gun shoots at once. Several values can be used. If no value is set, 1 will be used.
Toggling fire modes cycles between barrel configurations if several have been set.

Requires GameDir >= r2461

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8652 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-01-27 19:48:18 +00:00
Flugente 61553feb57 If CAN_FAN_THE_HAMMER is set for Gunslingers in Skills_Settings.ini, they can use burst fire if using revolvers with fBurstOnlyByFanTheHammer set to 1 and burst data set in Weapons.xml if they are in hipfire mode.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8651 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2019-01-24 21:48:44 +00:00
silversurfer 384572098b - fixed incorrect rounding in several places in the code
- diagonal movement now uses the proper amount of AP and BP

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8634 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-11-03 16:11:21 +00:00
silversurfer 2196a73b1a Fix (by Sevenfm) - penalty for shooting with a height difference was wrong
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8632 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-10-30 18:42:51 +00:00
silversurfer d1a94ee90d Fix (by Sevenfm) - shooting upwards penalty calculation was wrong
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8631 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-10-30 14:55:59 +00:00
Flugente 50d7b679c1 Added safety checks
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8626 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-30 19:40:55 +00:00
silversurfer 2aab4aff5d - added new parameters for NCTH in DifficultySettings.xml that allow the modification of CTH for militia and player mercs (requires GameDir 2445)
- re-enabled the extra elites for counter attacks

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8615 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-20 17:42:34 +00:00
silversurfer fed9ca298c - new modifiers "MISS_MAX_RADIUS_x" for grenades and mortar to set a max radius where they will land. Chance to hit something with explosives is now based more on skill than on luck.
- fixed infinite loop in function "RandomGridFromRadius" when min and max radius were 1
- fixed incorrect exit condition in function "RandomGridFromRadius" when min radius was 0
- fixed incorrect CtH calculation for mortar

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8598 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-08-22 17:54:24 +00:00
Flugente e15a61a5cc Fix: in OCTH, damage modifiers for guns are only displayed correctly if the gun fits into a small pocket
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8561 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-05-15 23:19:23 +00:00
Flugente 80674249cc New feature: bloodcat/zombie/bandit raids on player-controlled sectors
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23711&goto=353154&#msg_353154

Requires GameDir >= r2420

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8554 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-04-15 14:42:01 +00:00
Flugente c8e9a3fb8e Fix: if we steal from an enemy, they turn to us if they notice us
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8527 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-02-25 16:21:45 +00:00
Flugente 7a537c3a2e Fix: soldier automatically taunts us whenever we steal, making stealth impossible
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8526 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-02-24 20:45:27 +00:00
Flugente 92e759555d - New enemy role: display whether an enemy carries a key
For more, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=21774&goto=352502&#msg_352502
- If ENHANCED_CLOSE_COMBAT_SYSTEM is on, stealing multiple items from an enemy is possible if he is not on alert

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8523 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-02-21 18:49:35 +00:00
Flugente 3f057567dc - Added bayonet animations (standing against standing/crouched targets) for all merc bodytypes (by Taro)
- Initiating a bayonet attack immediately after running adds a melee damage bonus (+20%)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8489 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-10-02 10:38:12 +00:00
Sevenfm c24a5da97a - UseGunNCTH: initialize fBuckshot
- CreatureDecideActionBlack: use CreatureDecideActionRed instead of DecideActionRed

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8468 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-08-31 15:46:33 +00:00
Flugente 404e6f18ef Fix: stat loss on torso hit never causes STR loss
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8461 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-08-26 21:57:22 +00:00
Sevenfm f4cbb59720 - DisplayLoadScreenWithID: use strcmp to correctly compare strings
- CalcThrownChanceToHit: fix integer calculation
- CalcBestThrow: allow CTH bonus for mortars, new less restrictive CTH check to allow attack


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8443 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-08-09 14:32:16 +00:00
Flugente 8d3d77ad84 Trait change: Ambidextrous trait reduces cth penalty for having any item in offhand, not just if it is a handgun (PENALTY_TO_SHOOT_DOUBLE_GUNS_REDUCTION)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8428 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-07-25 18:24:39 +00:00
Sevenfm 6ce47c4cef - new option: ENEMY_JAMS in [Tactical Gameplay Settings] allows enemy gun jams
- take into account unjam AP cost for jammed weapon
- improved AI_BETTER_COVER option

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8409 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-06-21 07:40:36 +00:00
silversurfer 4f8498e5ef slightly modified the damage formula from r8370
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8371 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-01-22 14:09:26 +00:00
silversurfer a6b2568e24 - new jam damage thresholds for guns - when a gun jams it can only take damage if its status is below the threshold
- modified damage calculation for jam damage
- modified cleaning point calculation for mercs
- natural dirt level of sectors now halved if the shooter is inside a building

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8370 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2017-01-22 13:33:44 +00:00
silversurfer 372adc37b8 repair and dirt system change:
Dirt is now part of gun status. The original dirt system has been removed. For details see:
http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=20198&goto=347370&#msg_347370


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8325 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-10-19 15:58:02 +00:00
Sevenfm e7fe040722 CalcChanceToHitGun, CalcNewChanceToHitGun: set fCantSeeTarget = true when shooting at empty invisible tile
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8301 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-09-14 07:07:40 +00:00
silversurfer cedb77bffb Fixes (by Sevenfm):
- put back AIM_VISIBILITY calculation in function "CalcNewChanceToHitGun"
- fixed possible NULL pointer condition

Added an indicator to the NCTH cursor to show aiming penalty for moving target.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8294 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-09-03 11:56:00 +00:00
silversurfer 73e3e1172c Fix: gGameCTHConstants.BASE_CROUCHING_STANCE was missing from handling calculations in NCTH
- removed gGameExternalOptions.fUseNewCTHCalculation as it is not needed anymore
- cleaned up function CalcNewChanceToHitGun

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8281 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-08-06 10:44:42 +00:00
Flugente 2a7abe5b0d If ALLOW_TARGET_HEADANDLEG_IFPRONE is TRUE, head/torso/legs can be targetted on prone soldiers (until now, hits were always considered on torso).
Additionally soldiers are no longer protected from stray bullets in crouched and prone stance.

This option will be removed once this code change has been accepted (or deemed unacceptable).

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8264 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-07-02 18:04:49 +00:00
Sevenfm 9b2e65cade Punching: don't use kick animation when attacking with weapon in hand
Stealing: don't turn to attacker when lying prone (to prevent possible endless clock)
Bayonet:
- fix: disable wirecutters cursor in bayonet mode
- always use STAB attack for bayonet
- always give MELEE bonus when using bayonet

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8263 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-06-25 10:52:47 +00:00