|
RT,是在原版复刻的基础上改的
没发现两个事件的变量居然不一致,第二次出错了,惭愧惭愧~
——————————————————————
1,显示功能:
显示功能没啥好说的~就在原版的基础上加了一页的样子,感觉粗糙得可怕~懒得改了,召唤界面帝来改吧~~
- //显示状态
- procedure ShowStatus(rnum: integer);
- var
- i, magicnum, mlevel, needexp, x, y: integer;
- p: array[0..10] of integer;
- addatk, adddef, addspeed: integer;
- str: widestring;
- strs: array[0..21] of widestring;
- color1, color2: uint32;
- name: widestring;
- jingmai: array[0..15] of WideString;
- num: SmallInt;
- begin
- jingmai[0] := ' 手太阳';
- jingmai[1] := ' 手少阳';
- jingmai[2] := ' 手阳明';
- jingmai[3] := ' 手太阴';
- jingmai[4] := ' 手少阴';
- jingmai[5] := ' 手厥阴';
- jingmai[6] := ' 足太阳';
- jingmai[7] := ' 足少阳';
- jingmai[8] := ' 足阳明';
- jingmai[9] := ' 足太阴';
- jingmai[10] := ' 足少阴';
- jingmai[11] := ' 足厥阴';
- jingmai[12] := ' 任、督';
- jingmai[13] := ' 冲、带';
- jingmai[14] := ' 阳维、阳蹻';
- jingmai[15] := ' 阴维、阴蹻';
- strs[0] := ' 等級';
- strs[1] := ' 生命';
- strs[2] := ' 內力';
- strs[3] := ' 體力';
- strs[4] := ' 經驗';
- strs[5] := ' 升級';
- strs[6] := ' 攻擊';
- strs[7] := ' 防禦';
- strs[8] := ' 輕功';
- strs[9] := ' 醫療能力';
- strs[10] := ' 用毒能力';
- strs[11] := ' 解毒能力';
- strs[12] := ' 拳掌功夫';
- strs[13] := ' 御劍能力';
- strs[14] := ' 耍刀技巧';
- strs[15] := ' 特殊兵器';
- strs[16] := ' 暗器技巧';
- strs[17] := ' 裝備物品';
- strs[18] := ' 修煉物品';
- strs[19] := ' 所會武功';
- strs[20] := ' 受傷';
- strs[21] := ' 中毒';
- p[0] := 43;
- p[1] := 45;
- p[2] := 44;
- p[3] := 46;
- p[4] := 47;
- p[5] := 48;
- p[6] := 50;
- p[7] := 51;
- p[8] := 52;
- p[9] := 53;
- p[10] := 54;
- Redraw;
- x := 40;
- y := CENTER_Y - 160;
- DrawRectangle(x, y, 560, 315, 0, colcolor(255), 50);
- //显示头像
- drawheadpic(Rrole[rnum].HeadNum, x + 60, y + 80);
- //显示姓名
- name := big5tounicode(@Rrole[rnum].Name);
- drawshadowtext(@name[1], x + 68 - length(pchar(@Rrole[rnum].Name)) * 5, y + 85, colcolor($66), colcolor($63));
- //显示所需字符
- for i := 0 to 5 do
- drawshadowtext(@strs[i, 1], x - 10, y + 110 + 21 * i, colcolor($23), colcolor($21));
- for i := 6 to 16 do
- drawshadowtext(@strs[i, 1], x + 160, y + 5 + 21 * (i - 6), colcolor($66), colcolor($63));
- drawshadowtext(@strs[19, 1], x + 360, y + 5, colcolor($23), colcolor($21));
- addatk := 0;
- adddef := 0;
- addspeed := 0;
- if rrole[rnum].Equip[0] >= 0 then
- begin
- addatk := addatk + ritem[rrole[rnum].Equip[0]].AddAttack;
- adddef := adddef + ritem[rrole[rnum].Equip[0]].AddDefence;
- addspeed := addspeed + ritem[rrole[rnum].Equip[0]].AddSpeed;
- end;
- if rrole[rnum].Equip[1] >= 0 then
- begin
- addatk := addatk + ritem[rrole[rnum].Equip[1]].AddAttack;
- adddef := adddef + ritem[rrole[rnum].Equip[1]].AddDefence;
- addspeed := addspeed + ritem[rrole[rnum].Equip[1]].AddSpeed;
- end;
- //攻击, 防御, 轻功
- //单独处理是因为显示顺序和存储顺序不同
- str := format('%4d', [Rrole[rnum].Attack + addatk]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 0, colcolor($7), colcolor($5));
- str := format('%4d', [Rrole[rnum].Defence + adddef]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 1, colcolor($7), colcolor($5));
- str := format('%4d', [Rrole[rnum].Speed + addspeed]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 2, colcolor($7), colcolor($5));
- //其他属性
- str := format('%4d', [Rrole[rnum].Medcine]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 3, colcolor($7), colcolor($5));
- str := format('%4d', [Rrole[rnum].UsePoi]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 4, colcolor($7), colcolor($5));
- str := format('%4d', [Rrole[rnum].MedPoi]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 5, colcolor($7), colcolor($5));
- str := format('%4d', [Rrole[rnum].Fist]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 6, colcolor($7), colcolor($5));
- str := format('%4d', [Rrole[rnum].Sword]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 7, colcolor($7), colcolor($5));
- str := format('%4d', [Rrole[rnum].Knife]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 8, colcolor($7), colcolor($5));
- str := format('%4d', [Rrole[rnum].Unusual]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 9, colcolor($7), colcolor($5));
- str := format('%4d', [Rrole[rnum].HidWeapon]);
- drawengshadowtext(@str[1], x + 300, y + 5 + 21 * 10, colcolor($7), colcolor($5));
- //武功
- for i := 0 to 9 do
- begin
- magicnum := Rrole[rnum].magic[i];
- if magicnum > 0 then
- begin
- drawbig5shadowtext(@Rmagic[magicnum].Name, x + 360, y + 26 + 21 * i, colcolor($7), colcolor($5));
- str := format('%3d', [Rrole[rnum].MagLevel[i] div 100 + 1]);
- drawengshadowtext(@str[1], x + 520, y + 26 + 21 * i, colcolor($66), colcolor($64));
- end;
- end;
- str := format('%4d', [Rrole[rnum].Level]);
- drawengshadowtext(@str[1], x + 110, y + 110, colcolor($7), colcolor($5));
- //生命值, 在受伤和中毒值不同时使用不同颜色
- case RRole[rnum].Hurt of
- 34..66:
- begin
- color1 := colcolor($E);
- color2 := colcolor($10);
- end;
- 67..1000:
- begin
- color1 := colcolor($14);
- color2 := colcolor($16);
- end;
- else
- begin
- color1 := colcolor($7);
- color2 := colcolor($5);
- end;
- end;
- str := format('%4d', [RRole[rnum].CurrentHP]);
- drawengshadowtext(@str[1], x + 60, y + 131, color1, color2);
- str := '/';
- drawengshadowtext(@str[1], x + 100, y + 131, colcolor($66), colcolor($63));
- case RRole[rnum].Poision of
- 34..66:
- begin
- color1 := colcolor($30);
- color2 := colcolor($32);
- end;
- 67..1000:
- begin
- color1 := colcolor($35);
- color2 := colcolor($37);
- end;
- else
- begin
- color1 := colcolor($23);
- color2 := colcolor($21);
- end;
- end;
- str := format('%4d', [RRole[rnum].MaxHP]);
- drawengshadowtext(@str[1], x + 110, y + 131, color1, color2);
- //内力, 依据内力性质使用颜色
- if rrole[rnum].MPType = 0 then
- begin
- color1 := colcolor($50);
- color2 := colcolor($4E);
- end
- else if rrole[rnum].MPType = 1 then
- begin
- color1 := colcolor($7);
- color2 := colcolor($5);
- end
- else
- begin
- color1 := colcolor($66);
- color2 := colcolor($63);
- end;
- str := format('%4d/%4d', [RRole[rnum].CurrentMP, RRole[rnum].MaxMP]);
- drawengshadowtext(@str[1], x + 60, y + 152, color1, color2);
- //体力
- str := format('%4d/%4d', [rrole[rnum].PhyPower, MAX_PHYSICAL_POWER]);
- drawengshadowtext(@str[1], x + 60, y + 173, colcolor($7), colcolor($5));
- //经验
- str := format('%5d', [uint16(Rrole[rnum].Exp)]);
- drawengshadowtext(@str[1], x + 100, y + 194, colcolor($7), colcolor($5));
- str := format('%5d', [uint16(Leveluplist[Rrole[rnum].Level - 1])]);
- drawengshadowtext(@str[1], x + 100, y + 215, colcolor($7), colcolor($5));
- //str:=format('%5d', [Rrole[rnum,21]]);
- //drawengshadowtext(@str[1],150,295,colcolor($7),colcolor($5));
- //drawshadowtext(@strs[20, 1], 30, 341, colcolor($23), colcolor($21));
- //drawshadowtext(@strs[21, 1], 30, 362, colcolor($23), colcolor($21));
- //drawrectanglewithoutframe(100,351,Rrole[rnum,19],10,colcolor($16),50);
- //中毒, 受伤
- //str := format('%4d', [RRole[rnum].Hurt]);
- //drawengshadowtext(@str[1], 150, 341, colcolor($14), colcolor($16));
- //str := format('%4d', [RRole[rnum].Poision]);
- //drawengshadowtext(@str[1], 150, 362, colcolor($35), colcolor($37));
- //装备, 秘笈
- drawshadowtext(@strs[17, 1], x + 160, y + 240, colcolor($23), colcolor($21));
- drawshadowtext(@strs[18, 1], x + 360, y + 240, colcolor($23), colcolor($21));
- if Rrole[rnum].Equip[0] >= 0 then
- drawbig5shadowtext(@Ritem[Rrole[rnum].Equip[0]].Name, x + 170, y + 261, colcolor($7), colcolor($5));
- if Rrole[rnum].Equip[1] >= 0 then
- drawbig5shadowtext(@Ritem[Rrole[rnum].Equip[1]].Name, x + 170, y + 282, colcolor($7), colcolor($5));
- //计算秘笈需要经验
- if Rrole[rnum].PracticeBook >= 0 then
- begin
- mlevel := 1;
- magicnum := Ritem[Rrole[rnum].PracticeBook].Magic;
- if magicnum > 0 then
- for i := 0 to 9 do
- if Rrole[rnum].Magic[i] = magicnum then
- begin
- mlevel := Rrole[rnum].MagLevel[i] div 100 + 1;
- break;
- end;
- needexp := mlevel * Ritem[Rrole[rnum].PracticeBook].NeedExp * (7 - Rrole[rnum].Aptitude div 15);
- drawbig5shadowtext(@Ritem[Rrole[rnum].PracticeBook].Name, x + 370, y + 261, colcolor($7), colcolor($5));
- str := format('%5d/%5d', [uint16(Rrole[rnum].ExpForBook), needexp]);
- if mlevel = 10 then
- str := format('%5d/=', [uint16(Rrole[rnum].ExpForBook)]);
- drawengshadowtext(@str[1], x + 400, y + 282, colcolor($66), colcolor($63));
- end;
- //显示第一页
- SDL_UpdateRect(screen, x, y, 561, 316);
- WaitAnyKey;
- Redraw;
- DrawRectangle(x, y, 560, 315, 0, colcolor(255), 50);
- //显示头像
- drawheadpic(Rrole[rnum].HeadNum, x + 60, y + 80);
- //显示姓名
- name := big5tounicode(@Rrole[rnum].Name);
- drawshadowtext(@name[1], x + 68 - length(pchar(@Rrole[rnum].Name)) * 5, y + 85, colcolor($66), colcolor($63));
- for i := 0 to 15 do
- begin
- drawshadowtext(@jingmai[i, 1], x + 160 + 180*(i div 8), y + 20 + 21 * (i-((i div 8)*8)), colcolor($66), colcolor($63));
- num := (Rrole[rnum].Data[59]) shr i; //示例以声望为经脉值,偏移118
- num := num mod 2;
- if Boolean(num) then
- str := '开啓'
- else
- str := '關閉';
- drawshadowtext(@str[1], x + 300 + 180*(i div 8), y + 20 + 21 * (i-((i div 8)*8)), colcolor($7), colcolor($5));
- end;
- //显示第二页
- SDL_UpdateRect(screen, x, y, 561, 316);
- end;
复制代码
[ 本帖最后由 winson7891 于 2010-2-7 12:13 编辑 ] |
|