1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00
Commit Graph

47 Commits

Author SHA1 Message Date
95a07ee5cb Use bonus system cache whenever possible 2024-12-21 18:47:11 +00:00
be2327d000 Removed no longer used or redundant constants 2024-11-28 12:11:13 +00:00
2b99414793 Using hero's stats instead of level to determine their role.
Since there are custom maps/campaigns in which heroes have pretty high base-stats even at level 1.
2024-10-21 09:37:44 +02:00
5d6877e06d Merge remote-tracking branch 'upstream/develop' into develop 2024-10-20 00:49:17 +02:00
10ad0fc760 Split CHeroHandler.cpp/.h into 1 file per class
All parts of CHeroHandler.cpp are now in lib/entities/hero
Adjusted includes to use new paths
No functionality changes
2024-10-13 14:01:09 +00:00
61fba1fedd Merge remote-tracking branch 'upstream/develop' into develop 2024-10-10 17:23:39 +02:00
3dd4fa2528 Reduce usage of pointers to VLC entities
Final goal (of multiple PR's) is to remove all remaining pointers from
serializeable game state, and replace them with either identifiers or
with shared/unique pointers.

CGTownInstance::town and CGHeroInstance::type members have been removed.
Now this data is computed dynamically using subID member.

VLC entity of a town can now be accessed via following methods:
- getFactionID() returns ID of a faction
- getFaction() returns pointer to a faction
- getTown() returns pointer to a town

VLC entity of a hero can now be accessed via following methods:
- getHeroTypeID() returns ID of a hero
- getHeroClassID() returns ID of a hero class
- getHeroType() returns pointer to a hero
- getHeroClass() returns pointer to a hero class
2024-10-10 12:28:08 +00:00
f2b8b40925 Being less dismissive
Reduced the amount of circumstances under which the AI dismisses heroes. Among others to prevent a loop through all passes where it repeatedly hires and dismisses heroes.
2024-10-01 17:20:54 +02:00
2d783211ce Fixed a crash
Fixed a crash from trying to access nonexisting map-element.
2024-10-01 01:11:17 +02:00
769268cfe3 Eternal Garrison
Fixed an issue that caused heroes to stay garrisoned for ever when hero-cap was reached.
2024-09-29 01:15:09 +02:00
065125e770 Merge remote-tracking branch 'upstream/develop' into develop 2024-09-10 14:57:27 +02:00
8225eb454e Added GameSettings to gamestate, potentially allowing to define game
settings per map (or in random map template)
2024-09-05 15:16:27 +00:00
64fad53532 Revert "Merge branch 'pr/4528' into develop"
This reverts commit f4578c6d3a, reversing
changes made to ac8e5b3711.
2024-09-03 20:51:13 +02:00
f4578c6d3a Merge branch 'pr/4528' into develop 2024-08-30 22:09:43 +02:00
ca3d81f047 fix crash on heroRoles.clear() 2024-08-28 15:22:00 +02:00
f8f10adb2e Take magic-capability into account for overall strength-estimation of hero-lead-armies
The magic-strength of a hero now checks if the hero has a spellbook and at least one combat-spell.
The impact of knowledge and spellpower to the hero's magic-strength is now also depending on it's current and max mana-pool-size as an empty mana-pool does not exactly contribute well to fights.

Replaced every call of getFightingStrength() with getHeroStrength() which uses both the fightingStrength and the (reworked) magicStrength to guess how much stronger a hero-lead army is.
2024-07-15 17:42:02 +02:00
41ed7e2e10 Added TODO's for potential optimizations that I've discovered 2024-07-04 07:59:50 +00:00
24b77b0972 Remove access to hero name translation 2024-07-03 17:01:38 +00:00
390136e536 NKAI: fix patrolling heroes never retreat and town danger evaluation 2024-04-21 14:23:58 +03:00
419d6a648b NKAI: optimize clusterization and pathfinding for object graph 2024-03-24 09:32:54 +02:00
35429eab52 NKAI: moddable configuration 2024-03-01 22:03:07 +02:00
4c70abbeb5 Reduced usage of global variables - removed or made const / constexpr 2024-02-12 13:49:45 +02:00
60ca6f968c Fix hero limit check in AI 2023-11-27 14:08:49 +02:00
ac925bb786 Renamed new types for consistency with code style 2023-10-22 16:55:19 +03:00
b394158dc9 Bonus Source ID now uses metaidentifier 2023-10-22 16:55:18 +03:00
0a10fc30b8 (lib) Bonus subtype is now stored as metaidentifier that can store any
other identifier inside it
2023-10-22 16:54:43 +03:00
ebe155fa95 NKAI: mana recovery 2023-09-30 10:37:36 +03:00
ec0596f3dd NKAI: fix error message can not take away last stack 2023-07-31 22:01:12 +03:00
fb7477047a NKAI: loosen gold presure on build system. 2023-07-31 22:01:12 +03:00
6490c65490 nkai: fix freezes 2023-07-31 22:01:12 +03:00
5083100d3b NKA: fix accessing removed hero and heroExchangeCount 2023-07-31 22:01:11 +03:00
b19ac01bf9 Fuzzy rework, added more defence and gather army routines 2023-07-31 22:01:10 +03:00
85262cf4f5 Moved CGameState files into a separate directory 2023-06-26 17:15:59 +03:00
05eccbc2bb vcmi: split bonus to enumerator and HeroBonus.h 2023-05-03 18:01:06 +03:00
d347db4c16 Fix hero count calculation for resourceful ai mod 2023-04-22 14:47:31 +03:00
c4a3216288 NKAI: evaluate speciality correctly
With removal of SECONDARY_SKILL_PREMY, we need to
evaluate speciality by using TargetSourceType.
Just do it.
2023-03-16 16:46:41 +03:00
4bf570763a NKAI: improve neutral town priority handling, reduce priority of objects like star axis 2023-03-12 16:31:15 +02:00
148c3436df NKAI: improve army gathering 2023-03-08 11:53:26 +02:00
8b0c7b6601 NKAI improve defence and some fixes 2023-03-07 20:10:58 +02:00
fa6f7513e8 All heroes-related strings are passed through translator 2023-01-20 15:18:36 +02:00
eeea01d778 NKAI: namespace 2022-10-04 08:40:14 +03:00
b4241670ba Nullkiller: rename VCAI to AIGateway 2021-07-26 21:02:50 +03:00
b5b9619147 Nullkiller: fix build 2021-07-26 21:02:50 +03:00
1fdf0de75d Nullkiller: clusterization fixes, heroes clusterization for additional mains in case of locked heroes 2021-07-26 21:02:50 +03:00
4f51d3c929 Nullkiller: fix android 2021-07-26 21:02:50 +03:00
3e9bf9b662 Nullkiller: try to fix build 2021-07-26 21:02:50 +03:00
1806dd8447 Nullkiller: remove AIhelper + refactoring 2021-07-26 21:02:50 +03:00