Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLv-CN committed Sep 8, 2021
1 parent c7c28bf commit e2a3481
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 45 deletions.
1 change: 1 addition & 0 deletions DynamicPatcher/DPScripts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<Compile Include="Scripts\AAHeatSeeker2Script.cs" />
<Compile Include="Scripts\DISKScript.cs" />
<Compile Include="Scripts\FlameScript.cs" />
<Compile Include="Scripts\FlashScript.cs" />
<Compile Include="Scripts\FLHScript.cs" />
<Compile Include="Scripts\GGIScript.cs" />
<Compile Include="Scripts\GiantNukeUpScript.cs" />
Expand Down
2 changes: 1 addition & 1 deletion DynamicPatcher/ExtensionHooks/LaserDrawExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace ExtensionHooks
{
public class LaserDrawExtHooks
{
[Hook(HookType.AresHook, Address = 0x550F6A, Size = 8)]
// [Hook(HookType.AresHook, Address = 0x550F6A, Size = 8)]
public static unsafe UInt32 LaserDrawClass_Fade(REGISTERS* R)
{
return LaserDrawExt.LaserDrawClass_Fade(R);
Expand Down
69 changes: 54 additions & 15 deletions DynamicPatcher/ExtensionHooks/TechnoExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using PatcherYRpp;
using Extension.Ext;
using Extension.Script;
using Extension.Utilities;

namespace ExtensionHooks
{
Expand Down Expand Up @@ -262,20 +263,23 @@ public static unsafe UInt32 TechnoClass_DrawHealthBar_Other(REGISTERS* R)

// case VISUAL_NORMAL
[Hook(HookType.AresHook, Address = 0x7063FF, Size = 7)]
public static unsafe UInt32 TechnoClass_DrawSHP(REGISTERS* R)
public static unsafe UInt32 TechnoClass_DrawSHP_Colour(REGISTERS* R)
{
try
{
Pointer<TechnoClass> pTechno = (IntPtr)R->ESI;
TechnoExt ext = TechnoExt.ExtMap.Find(pTechno);
ext?.DrawSHP(R);
ext?.DrawSHP_Colour(R);
/*
// var ebp = R->EBP;
var eax = R->EAX;
if (!pTechno.IsNull && pTechno.Ref.Berzerk && !pTechno.Ref.IsVoxel() && pTechno.Ref.Base.Base.WhatAmI() == AbstractType.Unit)
if (!pTechno.IsNull && pTechno.Convert<ObjectClass>().Ref.IsSelected)
{
// R->EBP = 200;
R->EAX = 0x79C2780F;
var x = R->EAX;
Logger.Log("Unit[{0}] EAX = {1}", pTechno.Ref.Type.Ref.Base.Base.ID, x);
ColorStruct color = new ColorStruct(0, 255, 128);
ColorStruct colorAdd = ExHelper.Color2ColorAdd(color);
Logger.Log("RGB888 = {0}, RGB565 = {1}, RGB565 = {2}", color, colorAdd, ExHelper.ColorAdd2RGB565(colorAdd));
R->EAX = ExHelper.ColorAdd2RGB565(colorAdd);
}
*/
}
Expand All @@ -286,30 +290,65 @@ public static unsafe UInt32 TechnoClass_DrawSHP(REGISTERS* R)
return (uint)0;
}


/*
// before if Briz 0073C083
[Hook(HookType.AresHook, Address = 0x73C15F, Size = 7)]
public static unsafe UInt32 TechonClass_DrawVXL(REGISTERS* R)
// Igron check if berzerk
[Hook(HookType.AresHook, Address = 0x73C083, Size = 6)]
public static unsafe UInt32 TechonClass_DrawVXL_IfBerzerk(REGISTERS* R)
{
try
{
Pointer<UnitClass> pUnit = (IntPtr)R->EBP;
var tint = R->EDI;
if (!pUnit.IsNull && pUnit.Convert<ObjectClass>().Ref.IsSelected)
{
uint x = (uint)Drawing.Color16bit(RulesClass.BerserkColor);
R->EDI = tint | x;
Logger.Log("Unit[{0}] tint = {1}, x = {2}, xx = {3}", pUnit.Ref.Base.Base.Type.Ref.Base.Base.ID, tint, x, tint | x);
Pointer<TechnoClass> pTechno = pUnit.Convert<TechnoClass>();
if (pTechno.Ref.Berzerk)
{
return 0;
}
TechnoExt ext = TechnoExt.ExtMap.Find(pTechno);
Logger.Log("Unit[{0}] call 0x73c083 jump 0x73c091", pUnit.Ref.Base.Base.Type.Ref.Base.Base.ID);
return 0x73C091;
}
}
catch(Exception e)
catch (Exception e)
{
Logger.PrintException(e);
}
return 0;
}
*/

// change berzerk color
[Hook(HookType.AresHook, Address = 0x73C15F, Size = 7)]
public static unsafe UInt32 TechnoClass_DrawVXL_Colour(REGISTERS* R)
{
try
{
Pointer<UnitClass> pUnit = (IntPtr)R->EBP;
TechnoExt ext = TechnoExt.ExtMap.Find(pUnit.Convert<TechnoClass>());
ext?.DrawVXL_Colour(R);
/*
if (!pUnit.IsNull && pUnit.Convert<ObjectClass>().Ref.IsSelected)
{
Pointer<TechnoClass> pTechno = pUnit.Convert<TechnoClass>();
var x = R->ESI;
Logger.Log("Unit[{0}] ESI = {1}", pUnit.Ref.Base.Base.Type.Ref.Base.Base.ID, x);
ColorStruct color = new ColorStruct(0, 255, 128);
ColorStruct colorAdd = ExHelper.Color2ColorAdd(color);
Logger.Log("RGB888 = {0}, RGB565 = {1}, RGB565 = {2}", color, colorAdd, ExHelper.ColorAdd2RGB565(colorAdd));
R->ESI = ExHelper.ColorAdd2RGB565(colorAdd);
}
*/
}
catch (Exception e)
{
Logger.PrintException(e);
}
return 0;
}

[Hook(HookType.AresHook, Address = 0x738801, Size = 6)]
public static unsafe UInt32 UnitClass_Destory(REGISTERS* R)
{
Expand Down
2 changes: 1 addition & 1 deletion DynamicPatcher/Projects/Extension
102 changes: 75 additions & 27 deletions DynamicPatcher/WWSB专属食用说明书.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Proximity=yes ;抛射体与地面非友军任意目标处于同一个格子时
CourseLockDuration=0 ;上一条的安全距离,单位帧


; 炒粉
; 嘲讽,吸引特定单位将自身作为目标
[TechnoType]
AttackBeacon.Enable=yes
AttackBeacon.Types=V3,DRED ;炒粉谁
Expand Down Expand Up @@ -101,7 +101,7 @@ Speed=40
Burst=10 ;每次抛洒的数量,左右撒*2


; 单位死亡动画,强制使用单位色盘,带所属色,8的倍数则带方向,屏幕正上方为0,顺时针
; 单位死亡动画,强制使用单位色盘,带所属色,8的倍数则带方向,屏幕正上方为0,顺时针,带炮塔的单位以炮塔朝向为主要朝向
[TechnoType]
DestroyAnims=Anim1,Anim2,Anim3,Anim4,Anim5,Anim6,Anim7,Anim8
DestroyAnims.Random=no ;随机播放死亡动画,非8的倍数也随机
Expand All @@ -118,20 +118,22 @@ DestroySelfPeaceful=yes ;平静的消失,不发生爆炸
GiftBox.Types=HTNK,E2 ;礼物
GiftBox.Nums=1,1 ;数量
GiftBox.Remove=yes ;开盒后删除盒子
GiftBox.Destroy=no ;开合后删除盒子时盒子会不会炸
; GiftBox.Destroy=no ;(更名)开合后删除盒子时盒子会不会炸
GiftBox.Explodes=no ;删除盒子后会不会引起爆炸,触发死亡武器
GiftBox.Delay=0 ;多久后开盒
GiftBox.RandomDelay=0,300 ;随机延迟
GiftBox.RandomRange=0 ;礼物刷在附近随机范围内,单位格
GiftBox.EmptyCell=no ;礼物只在空地上刷,没有空地就刷在原地
; GiftBox.EmptyCell=no ;(更名)礼物只在空地上刷,没有空地就刷在原地
GiftBox.RandomToEmptyCell=no ;礼物只在空地上刷,没有空地就刷在原地
GiftBox.RandomType=no ;随机从列表中选取类型,并创建等于nums的总数量



; Jumpjet载具攻击时面向目标,不能替代OmniFire,AI不吃这套
; Jumpjet载具攻击时面向目标
[TechnoType]
JumpJet=yes ;注意大小写,wwsb
JumpjetFacingToTarget=yes
JumpjetFacing=8 ;细分面数,8的倍数
JumpjetFacing=8 ;细分面数,8的倍数,建议不要改动


; 步兵单位卧倒时的FLH设置
Expand All @@ -142,25 +144,25 @@ SecondaryCrawlingFLH=150,0,225
EliteSecondaryCrawlingFLH=150,0,225


; 激光yi巴,Phobos(即将)有同类型功能
[ProjectileType]
[TechnoType]
UseLaserTrail=yes
IsHouseColor=no ;启用阵营色,
IsSupported=no ;更亮
LaserInnerColor=204,64,6 ;yi巴的颜色
LaserOuterColor=102,32,3 ;IsHouseColor=yes 或者 LaserFade=yes 时无效
LaserOuterSpread=0,0,0 ;同上
LaserDuration=15 ;yi巴的持续时间,持续时间越长yi巴越长
LaserThickness=2 ;yi巴的宽度
LaserDistance=100 ;距离多远画一段yi巴,256为1格,越短资源消耗越大,yi巴越平滑
LaserFade=yes ;yi巴尖尖
LaserTailFLH=200,50,10 ;yi巴的位置,最多支持5个,[ProjectileType]无效
LaserTailFLH2=200,-50,10
LaserTailFLH3=200,0,10
LaserTailIgnoreVertical=no ;忽略垂直方向的移动,如战机升空,[ProjectileType]无效
LaserTailInitialDelay=0 ;初始化延迟,[ProjectileType]无效
LaserTailOnTurret=no ;尾迹在炮塔上,[ProjectileType]无效
; 激光yi巴,Phobos已有同类型功能且更完善
; [ProjectileType]
; [TechnoType]
; UseLaserTrail=yes
; IsHouseColor=no ;启用阵营色,
; IsSupported=no ;更亮
; LaserInnerColor=204,64,6 ;yi巴的颜色
; LaserOuterColor=102,32,3 ;IsHouseColor=yes 或者 LaserFade=yes 时无效
; LaserOuterSpread=0,0,0 ;同上
; LaserDuration=15 ;yi巴的持续时间,持续时间越长yi巴越长
; LaserThickness=2 ;yi巴的宽度
; LaserDistance=100 ;距离多远画一段yi巴,256为1格,越短资源消耗越大,yi巴越平滑
; LaserFade=yes ;yi巴尖尖
; LaserTailFLH=200,50,10 ;yi巴的位置,最多支持5个,[ProjectileType]无效
; LaserTailFLH2=200,-50,10
; LaserTailFLH3=200,0,10
; LaserTailIgnoreVertical=no ;忽略垂直方向的移动,如战机升空,[ProjectileType]无效
; LaserTailInitialDelay=0 ;初始化延迟,[ProjectileType]无效
; LaserTailOnTurret=no ;尾迹在炮塔上,[ProjectileType]无效


; 乖巧的乘客
Expand All @@ -170,7 +172,7 @@ Passengers.PassiveAcquire=yes ;乘客是否主动索敌
Passengers.ForceFire=yes ;强制乘客与载具攻击同一个目标


; 支援子机的武器,子机发射时,从母鸡身上某处绘制一条激光(暂时)朝向子机
; 支援子机的武器,子机发射时,从母鸡身上某处发射一个不会造成伤害的武器朝向子机
[TechnoType]
SupportSpawns=yes ;写在母舰上
SupportSpawns.Weapon=BotLaserSupport ;武器
Expand Down Expand Up @@ -205,4 +207,50 @@ AircraftPutOffsetForce=no ;强制偏移
[AircraftType]
NoHelipadPutOffset=0,0,12
ForcePutOffset=no
RemoveIfNoDocks=yes
RemoveIfNoDocks=yes


; 攻击标记,被命中的敌人与攻击者建立联系,持续期间额外发射武器,附加武器受单位的精英技能和宝箱加成影响
[WarheadType] ;Attacker
AttackerMark.Enable=yes
AttackerMark.Types=HTNK ;限定影响的单位类型
AttackerMark.Animation=LOCKED ;附着的动画
AttackerMark.Duration=-1 ;标记持续的时间
AttackerMark.AutoFireWeapon=-1 ;自动使用单位身上的武器
AttackerMark.FormTarget=no ;从被标记的目标向攻击者发射武器
AttackerMark.Weapon=HoverMissile ;自定义发射的武器
AttackerMark.EliteWeapon=HoverMissileE ;自定义精英单位发射的武器
AttackerMark.WeaponFLH=0,0,0 ;自定义发射的武器的FLH
AttackerMark.EliteWeaponFLH=0,0,0 ;自定义精英单位发射的武器的FLH
AttackerMark.RadialFire=no ;按照Burst伞形发射,仅影响ROT类型的自定义武器


; 附加武器,在主武器/副武器发射的同时发射附加的多个武器,附加武器受单位的精英技能和宝箱加成影响
[TechnoType]
AttachWeapon.Primary=RedEye2,RadBeamWeapon,ElectricBolt
AttachWeapon.PrimaryFLH=0,0,0
AttachWeapon.Secondary=RedEye2
AttachWeapon.SecondaryFLH=0,0,0
AttachWeapon.ElitePrimary=RedEye2,RadBeamWeapon,ElectricBolt
AttachWeapon.ElitePrimaryFLH=0,0,0
AttachWeapon.EliteSecondary=RedEye2
AttachWeapon.EliteSecondaryFLH=0,0,0
AttachWeapon.UseROF=no ;启用则每个附加武器独立计算ROF
AttachWeapon.RadialFire=no ;按照Burst伞形发射,仅影响ROT类型


; 翻转导弹类型抛射体初始发射方向,不翻转Z方向
[ProjectileType]
ReverseVelocity=no
ReverseVelocityZ=no ;是否翻转Z方向


; 彩弹,被命中的敌人会被染上颜色
[WarheadType] ;Attacker
Paintball.Color=255,255,255 ;RGB888,需要大于128才会显色,比如:金色=(180,170,0)
Paintball.Duration=-1
Paintball.IsHouseColor=no




0 comments on commit e2a3481

Please sign in to comment.