forked from Phobos-developers/Phobos
-
Notifications
You must be signed in to change notification settings - Fork 0
Force weapon by type #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Coronia
wants to merge
25
commits into
develop
Choose a base branch
from
force-weapon-by-type
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
610296a to
4027758
Compare
…type # Conflicts: # CREDITS.md # docs/New-or-Enhanced-Logics.md # src/Ext/Techno/Body.h # src/Ext/Techno/Hooks.Firing.cpp # src/Ext/Techno/WeaponHelpers.cpp # src/Ext/TechnoType/Body.cpp
4027758 to
5b4225b
Compare
…hobos-developers#1725) - `ExpireWeapon.UseInvokerAsOwner` can be used to set the house and TechnoType that created the effect (e.g firer of the weapon that applied it) as the weapon's owner & invoker instead of the object the effect is attached to. - `RevengeWeapon.UseInvokerAsOwner` can be used to set the house and TechnoType that created the effect (e.g firer of the weapon that applied it) as the weapon's owner & invoker instead of the object the effect is attached to. - `ReflectDamage.UseInvokerAsOwner` can be used to set the house and TechnoType that created the effect (e.g firer of the weapon that applied it) as the reflected damage's owner & invoker instead of the object the effect is attached to. In `rulesmd.ini`: ```ini [SOMEATTACHEFFECT] ; AttachEffectType ExpireWeapon.UseInvokerAsOwner=false ; boolean RevengeWeapon.UseInvokerAsOwner=false ; boolean ReflectDamage.UseInvokerAsOwner=false ; boolean ```
…evelopers#1723) ### Allows refineries to use multiple ActiveAnim simultaneously - In vanilla, the refinery uses different ActiveAnims depending on the storage. You can now make it use multiple ActiveAnims simultaneously like any other building. In `artmd.ini`: ```ini [SOMEBUILDING] ; BuildingType Refinery.UseNormalActiveAnim=false ; boolean ```
- replace it with Type variable for Aircraft, Building, Infantry and Unit classes - replace Find(techno->GetTechnoType()) with Find(techno)->TypeExtData
…os-developers#1728) previous `Damage.DealtByInvoker` doesn't really apply to anim warhead, this PR makes it inline with anim weapon. Notice that this might change the behavior of anim weapon and warhead a bit, but I think this should be the correct way. Any other feedbacks and reviews are welcome `Damage.ApplyFirepowerMult` determines whether or not firepower modifiers from the animation's invoker are applied on the damage dealt from this animation, if exists
…hobos-developers#1729) In vanilla game, aircraft will always return to airport even it still has remain ammo and planning after target has been destroyed. For now, the aircraft will continue attack next planning target if it still has ammo.
- Fix `Spawner.LimitRange` - Fix `IronCurtainColor`, `ForceShieldColor` and `BerserkColor` - Remove unnecessary `pINI->GetSection(pSection)` judgments and their hooks. --------- Co-authored-by: NetsuNegi39 <negi542554365@outlook.com> Co-authored-by: Coronia <2217891145@qq.com>
- LaserTrail can now drawn as other behaviour like EBolt or RadBeam. - 激光轨迹现在可以绘制成电弧或辐射波的样式。 - You can also specific laser trail on attacheffect, the trail will disappear if attacheffect is expired. - 你也可以在AE上指定激光轨迹,这种激光轨迹将会在AE过期后消失。 [SOMETRAIL] ; LaserTrailType name DrawType=laser ; enumeration (laser | ebolt | radbeam) IsAlternateColor=false ; boolean Bolt.Color1= ; r, g, b Bolt.Disable1=false ; boolean Bolt.Color2= ; r, g, b Bolt.Disable2=false ; boolean Bolt.Color3= ; r, g, b Bolt.Disable3=false ; boolean Beam.Color= ; r, g, b Beam.Amplitude=40.0 ; double FadeDuration= ; integer, default 64 for laser, 17 for electric, 15 for radbeam [SOMEATTACHEFFECT] LaserTrail.Type= ; lasertrail type --------- Co-authored-by: CrimRecya <335958461@qq.com> Co-authored-by: Coronia <2217891145@qq.com>
split from Phobos-developers#1568. This one is a bit controversial so I'd pull this alone for test and review - instead of selecting weapon for every bullet, used the fixed value from `Interceptor.Weapon` once and for all - added a RearmTimer check for the interceptor process
- Now, the original `DebrisMaximums` can be used in conjunction with new
`DebrisMinimums` to limit the quantity of `DebrisTypes` when
`DebrisTypes.Limit` is enabled.
- The default value of `DebrisTypes.Limit` is whether the number of
`DebrisMaximums` is greater than (not equal to) 1 (for compatibility
reasons).
In `rulesmd.ini`:
```ini
[SOMETECHNO] ; TechnoType
DebrisTypes.Limit= ; boolean
DebrisMaximums= ; List of integers
DebrisMinimums= ; List of integers
[SOMEWARHEAD] ; WarheadType
DebrisTypes.Limit= ; boolean
DebrisMaximums= ; List of integers
DebrisMinimums= ; List of integers
```
```{hint}
How to generate `DebrisTypes` in the game:
- Generate the total number of debris through `MaxDebris` and `MinDebris` first.
- Traverse `DebrisTypes` and limit the quantity range through `DebrisMaximums` and `DebrisMinimums`.
- When the number of generated debris will exceeds the total number, limit the quantity and end the traversal.
- When the number of debris generated after a single traversal is not enough to exceed the total number, it will end if `DebrisTypes.Limit` is enabled, otherwise the traversal will restart like vanilla game do.
```
### Attack move - behavior when target acquired
- Now you can make attacking moving units stop moving when they spot an
enemy using `AttackMove.StopWhenTargetAcquired`. This is more like the
attack move behavior in starcraft and warcraft.
- This function is used to prevent units from charging forward and
taking on more damage.
- You can also make them move towards the spotted target using
`AttackMove.PursuitTarget`.
- This function is used for close range units like ZEP.
In `rulesmd.ini`:
```ini
[General]
AttackMove.StopWhenTargetAcquired= ; boolean
[SOMETECHNO] ; TechnoType
AttackMove.StopWhenTargetAcquired= ; boolean, default to [General] -> AttackMove.StopWhenTargetAcquired if set, inverse of OpportunityFire otherwise.
AttackMove.PursuitTarget= ; boolean
```
```{note}
1. Many units would have stopped when they found an enemy. This behavior is independent of `AttackMove.StopWhenTargetAcquired`.
2. Some units (f.ex. jumpjets) will not fire correctly under the vanilla attack move. The exact reason is not clear, but this feature can fix this problem.
3. Jumpjets with `AttackMove.StopWhenTargetAcquired=true` will stop immediatly and not scatter to a cell. This is designed for practical reason.
```
### Attack move - follow
- Now you can have some units follow surrounding units when executing an
attack move. The following behavior is equivalent to the behavior when
using `ctrl + alt`.
- Use `AttackMove.Follow.IncludeAir` to determine whether the follower
will choose an air unit as a follow target.
- This function should be useful for auxiliary units such as medics and
repair drones.
- We have made additional optimizations to the followed target selection
algorithm to make this function more practical.
In `rulesmd.ini`:
```ini
[SOMETECHNO] ; TechnoType
AttackMove.Follow=false ; boolean
AttackMove.Follow.IncludeAir=false ; boolean
```
### Attack move - without weapon
- In vanilla, a unit without weapon is not allowed to attack move. Now
you can disable this hardcoded behavior using
`AttackMove.IgnoreWeaponCheck=true`.
- Unarmed units of course cannot actually execute attack moves. This
feature is to prevent the attack move pointer from being disabled when
you select unarmed units and other units at the same time.
In `rulesmd.ini`:
```ini
[General]
AttackMove.IgnoreWeaponCheck=false ; boolean
```
---------
Co-authored-by: Coronia <2217891145@qq.com>
Co-authored-by: CrimRecya <335958461@qq.com>
- `Grounded` has been abandoned, you can now use `GroundShape` to specific a image which always draw on ground, it will only draw when techno is in air if set `Ground.AlwaysDraw=false`, this also affect on `GroundLine`. - `Grounded` 已经被废弃了,你现在可以通过 `GroundShape` 指定一个始终绘制在地面的图像,若 `Ground.AlwaysDraw=false` ,那么它只会在单位位于空中时绘制,这也影响 `GroundLine` 的绘制。 - If `GroundLine=true` , the game will draw a line from techno's position to its vertical projection, `GroundLine.Dashed=true` means the projection line is a dashed line. - 若 `GroundLine=true` ,那么游戏将会绘制一条从单位的位置到其垂直投影的线,`GroundLine.Dashed=true` 意味着投影线为虚线。 In `rulesmd.ini`: ```ini [SOMESELECTBOXTYPE] ; Select box Type name GroundShape= ; filename with .shp extension GroundPalette=palette.pal ; filename with .pal extension GroundFrames= ; List of integer, default 1,1,1 for infantry, 0,0,0 for vehicle and aircraft GroundOffset=0,0 ; integers - horizontal, vertical Ground.AlwaysDraw=true ; boolean GroundLine=false ; boolean GroundLineColor=0,255,0 ; R, G, B GroundLineColor.ConditionYellow= ; R, G, B GroundLineColor.ConditionRed= ; R, G, B GroundLine.Dashed=false ; boolean ```  --------- Co-authored-by: CrimRecya <335958461@qq.com>
 You are free to decide whether to use Weapon x or not, instead of passively using Primary/secondary. 您可以自由决定是否启动WeaponX,而不是只能使用主/副武器。 - TechnoType reads `WeaponX` as their weapon when `MultiWeapon=yes`, be careful not to forget `WeaponCount`. `MultiWeapon=yes`时会读取`WeaponX`作为他们的武器,注意不要忘记了`WeaponCount`。 - `MultiWeapon.IsSecondary` can only be used by infantry, who will play the animation `SecondaryFire` when using these weapons. `MultiWeapon.IsSecondary`只能用于步兵,使用这些武器时步兵会播放`SecondaryFire`。 - `MultiWeapon.SelectCount` determines the number of weapons that can be selected. The lower the number the better the performance. The default is 2. `MultiWeapon.SelectCount`决定可选择的武器数量。数量越少性能越好。默认为 2。 In `rulesmd.ini`: ```ini [SOMETECHNO] ; TechnoType MultiWeapon= ; boolean MultiWeapon.IsSecondary= ; List of integers MultiWeapon.SelectCount= ; integer ```
…type # Conflicts: # CREDITS.md
3960bfd to
7a543a0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ForceWeapon.Defensesis enabled, it'll be used if the target is a building withIsBaseDefense=yes. Otherwise it'll followForceWeapon.Buildings, if enabled.ForceWeapon.Infantry/Units/Aircraftcan be applied to both ground and air target ifForceAAWeapon.Infantry/Units/Aircraftis not set.ForceAAWeapon.Infantry/Units/Aircraftdo the same things but only for air target. Taking priority toForceWeapon.Infantry/Units/Aircraft, which means that they can only be applied to ground target when they're both set.In
rulesmd.ini: