每回合初始时状态自动恢复与否,在0x42AF30,判断在0x42ADE7
void __fastcall sub_42AF30(int a1)
{
char v1; // al@4
char v2; // al@10
int v3; // [sp+Ch] [bp-4h]@1
v3 = a1;
if ( (unsigned __int8)sub_409830(a1) == 2 )
{
if ( sub_42DF80() & 0x40 )
{
v1 = sub_4096D0(v3);
sub_4096A0(v1 & 0xBF);
}
else
{
if ( (signed int)*(_BYTE *)(v3 + 20) <= 2 )
{
if ( (signed int)*(_BYTE *)(v3 + 20) < 2 ) // 攻击力上升
sub_42ADE7(v3, 0, *(_BYTE *)(v3 + 20) + 1, *(_BYTE *)(v3 + 20));
}
else // 攻击力下降
{
sub_42ADE7(v3, 0, *(_BYTE *)(v3 + 20) - 1, *(_BYTE *)(v3 + 20));
}
}
if ( sub_42DFA0() & 0x40 )
{
v2 = sub_409730(v3);
sub_409700(v2 & 0xBF);
}
else
{
if ( (signed int)*(_BYTE *)(v3 + 21) <= 2 )
{
if ( (signed int)*(_BYTE *)(v3 + 21) < 2 ) // 防御力上升
sub_42ADE7(v3, 1, *(_BYTE *)(v3 + 21) + 1, *(_BYTE *)(v3 + 21));
}
else // 防御力下降
{
sub_42ADE7(v3, 1, *(_BYTE *)(v3 + 21) - 1, *(_BYTE *)(v3 + 21));
}
}
if ( sub_42DFC0(v3) & 0x40 )
{
sub_4097D0(v3, 64);
}
else
{
if ( sub_409150(v3, 1) ) // 移动力下降
sub_42ADE7(v3, 3, 129, 2);
if ( sub_409150(v3, 2) ) // 攻击速度下降
sub_42ADE7(v3, 3, 130, 2);
if ( sub_409150(v3, 4) ) // 封策
sub_42ADE7(v3, 3, 132, 2);
if ( sub_409150(v3, 8) ) // 减轻策略损伤
sub_42ADE7(v3, 3, 136, 2);
if ( sub_409150(v3, 16) ) // 混乱
{
sub_42ADE7(v3, 3, 144, 2);
sub_42BEBF(v3);
}
if ( sub_409150(v3, 32) ) // 耐久力每回合减少
sub_42ADE7(v3, 3, 160, 2);
}
}
}
----------------------------------------------
void __thiscall sub_42ADE7(int this, int a2, int a3, char a4)
{
int v4; // ebx@4
int v5; // eax@4
unsigned int v6; // ebx@4
int v7; // ebx@9
int v8; // eax@9
unsigned int v9; // ebx@9
int v10; // [sp+10h] [bp-Ch]@1
int v11; // [sp+18h] [bp-4h]@1
int v12; // [sp+14h] [bp-8h]@1
signed int v13; // [sp+Ch] [bp-10h]@4
v10 = this;
v11 = 0;
v12 = (int)((char *)&dword_4556E8 + 54 * *(_DWORD *)this);
if ( ((unsigned __int8)a2 != 3 || a3 & 8) && (signed int)(unsigned __int8)a4 <= 2 )// 从良好状态复原(攻防上升、减轻策略损伤)
{
if ( a3 & 8 || (signed int)(unsigned __int8)a4 < 2 )
{
v7 = (unsigned __int8)sub_409110(v12); // 取智力
v8 = sub_42A227(v10); // 取防御力
v9 = sub_447328((v7 + v8) / 0x64u + 20); // 随机数
if ( v9 <= (unsigned __int8)sub_42AC4E(*(_BYTE *)(v10 + 4), 0) )
sub_428A0B((int)dword_46C088, *(_DWORD *)v10, a2, a3, 1);
}
}
else // 从不良状态复原
{
v13 = 20;
v4 = (unsigned __int8)sub_409110(v12); // 取智力
v5 = sub_42A227(v10); // 取防御力
v6 = sub_447328(v13 - (v4 + v5) / 0x64u); // 随机数
if ( v6 <= (unsigned __int8)sub_42AC4E(*(_BYTE *)(v10 + 4), 1) )
sub_428A0B((int)dword_46C088, *(_DWORD *)v10, a2, a3, 1);
}
}
------------------------------------------------
char __cdecl sub_42AC4E(char a1, char a2)
{
int v3; // [sp+10h] [bp-Ch]@1
char v4; // [sp+14h] [bp-8h]@1
unsigned int v5; // [sp+Ch] [bp-10h]@1
char v6; // [sp+18h] [bp-4h]@3
v3 = sub_409130((int)((char *)&dword_46C098 + 23 * (unsigned __int8)a1));
v4 = sub_4092A0((int)((char *)&dword_46C098 + 23 * (unsigned __int8)a1));// 取兵种
v5 = (unsigned __int8)sub_40C2BC(v3); // 和兵种相关的一个值
if ( v5 > 0xB ) // 兵种代码>=30
{
LABEL_18:
if ( (unsigned __int8)v4 != 32 && (unsigned __int8)v4 != 33 && (unsigned __int8)v4 != 38 )// 南蛮兵、南蛮骑兵等少数民族持有兵种
{
if ( a2 ) // 良好状态复原
v6 = 1;
else // 不良状态复原
v6 = 4;
}
else // 皇帝、都督、幻术师
{
if ( a2 )
v6 = 4;
else
v6 = 1;
}
}
else // 0<=v5<=11
{
switch ( *((_BYTE *)byte_42ADCE + v5) ) // 0x0042ADCE: 00 00 01 02 02 03 04 05 05 07 06 06 8A 45
{
case 0: // 步兵系、弓兵系
case 2: // 战车系、炮车系
if ( a2 )
v6 = 3;
else
v6 = 2;
break;
case 1: // 骑兵系
case 3: // 弓骑兵系
case 5: // 贼兵系、武术家系
if ( a2 )
v6 = 2;
else
v6 = 3;
break;
case 4: // 军师系
if ( a2 )
v6 = 10;
else
v6 = 1;
break;
case 6: // 运粮队、物资队、军乐队
if ( a2 )
v6 = 4;
else
v6 = 1;
break;
case 7: // 虎兵系
goto LABEL_18;
}
}
return v6;
}
----------------------------------------------
char __cdecl sub_40C2BC(int a1)
{
__int16 v1; // ax@2
char v2; // al@1
char v3; // [sp+10h] [bp-4h]@1
signed int v4; // [sp+Ch] [bp-8h]@5
v2 = sub_4092D0((int)((char *)&dword_4556E8 + 54 * a1)); // 取兵种
v3 = v2;
if ( (signed int)(unsigned __int8)v2 > 20 ) // 20大军师 21山贼
{
if ( (signed int)(unsigned __int8)v3 > 28 ) // 28物资队 29军乐队
{
v4 = (unsigned __int8)v3;
if ( v4 == 29 ) // 29军乐队
{
LOBYTE(v1) = 11;
}
else
{
if ( v4 >= 30 && v4 <= 31 ) // 30南蛮兵 31南蛮骑兵
LOBYTE(v1) = 12;
else // >32
LOBYTE(v1) = 14;
}
}
else // 兵种代码21~28
{
LOBYTE(v1) = (unsigned __int8)(((unsigned __int8)v3 - 21) / 2) + 7;// 取值可能有7,8,9,10
}
}
else // 兵种代码0~20
{
v1 = (unsigned __int8)v3 / 3; // 取值可能有0,1,2,3,4,5,6
}
return v1;
}
[ 本帖最后由 阿尔法孝直 于 2010-8-8 00:44 编辑 ]
|