diff --git a/DynamicPatcher/DPScripts.csproj b/DynamicPatcher/DPScripts.csproj index 0aa9f5d..157788e 100644 --- a/DynamicPatcher/DPScripts.csproj +++ b/DynamicPatcher/DPScripts.csproj @@ -58,6 +58,7 @@ + diff --git a/DynamicPatcher/ExtensionHooks/LaserDrawExt.cs b/DynamicPatcher/ExtensionHooks/LaserDrawExt.cs index 963570d..4884713 100644 --- a/DynamicPatcher/ExtensionHooks/LaserDrawExt.cs +++ b/DynamicPatcher/ExtensionHooks/LaserDrawExt.cs @@ -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); diff --git a/DynamicPatcher/ExtensionHooks/TechnoExt.cs b/DynamicPatcher/ExtensionHooks/TechnoExt.cs index 527d1fd..d79cc6a 100644 --- a/DynamicPatcher/ExtensionHooks/TechnoExt.cs +++ b/DynamicPatcher/ExtensionHooks/TechnoExt.cs @@ -8,6 +8,7 @@ using PatcherYRpp; using Extension.Ext; using Extension.Script; +using Extension.Utilities; namespace ExtensionHooks { @@ -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 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().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); } */ } @@ -286,23 +290,28 @@ 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 pUnit = (IntPtr)R->EBP; - var tint = R->EDI; if (!pUnit.IsNull && pUnit.Convert().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 pTechno = pUnit.Convert(); + 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); } @@ -310,6 +319,36 @@ public static unsafe UInt32 TechonClass_DrawVXL(REGISTERS* R) } */ + // change berzerk color + [Hook(HookType.AresHook, Address = 0x73C15F, Size = 7)] + public static unsafe UInt32 TechnoClass_DrawVXL_Colour(REGISTERS* R) + { + try + { + Pointer pUnit = (IntPtr)R->EBP; + TechnoExt ext = TechnoExt.ExtMap.Find(pUnit.Convert()); + ext?.DrawVXL_Colour(R); + /* + if (!pUnit.IsNull && pUnit.Convert().Ref.IsSelected) + { + Pointer pTechno = pUnit.Convert(); + 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) { diff --git a/DynamicPatcher/Projects/Extension b/DynamicPatcher/Projects/Extension index d1a970c..23b9647 160000 --- a/DynamicPatcher/Projects/Extension +++ b/DynamicPatcher/Projects/Extension @@ -1 +1 @@ -Subproject commit d1a970c2b4ca93e77949a9a522977b62d13e76f6 +Subproject commit 23b96475c55aae7b575eeff298a8b854a7b2dcb9 diff --git a/DynamicPatcher/Projects/YRpp b/DynamicPatcher/Projects/YRpp index 20f8981..efaae8a 160000 --- a/DynamicPatcher/Projects/YRpp +++ b/DynamicPatcher/Projects/YRpp @@ -1 +1 @@ -Subproject commit 20f89815529358b8a0797485573db8eb6e561cb6 +Subproject commit efaae8af1ef66b3acacfa101b9ef5e710e074b71 diff --git "a/DynamicPatcher/WWSB\344\270\223\345\261\236\351\243\237\347\224\250\350\257\264\346\230\216\344\271\246.ini" "b/DynamicPatcher/WWSB\344\270\223\345\261\236\351\243\237\347\224\250\350\257\264\346\230\216\344\271\246.ini" index 2f6ec73..e29ab41 100644 --- "a/DynamicPatcher/WWSB\344\270\223\345\261\236\351\243\237\347\224\250\350\257\264\346\230\216\344\271\246.ini" +++ "b/DynamicPatcher/WWSB\344\270\223\345\261\236\351\243\237\347\224\250\350\257\264\346\230\216\344\271\246.ini" @@ -64,7 +64,7 @@ Proximity=yes ;抛射体与地面非友军任意目标处于同一个格子时 CourseLockDuration=0 ;上一条的安全距离,单位帧 -; 炒粉 +; 嘲讽,吸引特定单位将自身作为目标 [TechnoType] AttackBeacon.Enable=yes AttackBeacon.Types=V3,DRED ;炒粉谁 @@ -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的倍数也随机 @@ -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设置 @@ -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]无效 ; 乖巧的乘客 @@ -170,7 +172,7 @@ Passengers.PassiveAcquire=yes ;乘客是否主动索敌 Passengers.ForceFire=yes ;强制乘客与载具攻击同一个目标 -; 支援子机的武器,子机发射时,从母鸡身上某处绘制一条激光(暂时)朝向子机 +; 支援子机的武器,子机发射时,从母鸡身上某处发射一个不会造成伤害的武器朝向子机 [TechnoType] SupportSpawns=yes ;写在母舰上 SupportSpawns.Weapon=BotLaserSupport ;武器 @@ -205,4 +207,50 @@ AircraftPutOffsetForce=no ;强制偏移 [AircraftType] NoHelipadPutOffset=0,0,12 ForcePutOffset=no -RemoveIfNoDocks=yes \ No newline at end of file +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 + + + +