on Init --戦闘初期化 global gcount,MDATA,gwait put empty into bg fld "PartyNames" put empty into bg fld "EnemyNames" put empty into bg fld "PartyHPs" put empty into bg fld "PartyMPs" repeat with i=1 to 6 if item 1 of line i of MDATA is not empty then show cd btn ID i else hide cd btn id i if item 3 of line i of MDATA > 0 then set icon of cd btn ID i to (item 2 of line i of MDATA)+40 else if i>3 then hide cd btn id i else set icon of cd btn ID i to (item 2 of line i of MDATA)+42 end if if i<4 then if item 1 of line i of MDATA is not empty then put item 1 of line i of MDATA into line i of bg fld "PartyNames" put Trunc(item 3 of line i of MDATA)&&"/"&&Trunc(item 4 of line i of MDATA) into line i of bg fld "PartyHPs" put Trunc(item 5 of line i of MDATA)&&"/"&&Trunc(item 6 of line i of MDATA) into line i of bg fld "PartyMPs" end if else if item 1 of line i of MDATA is not empty then put item 1 of line i of MDATA into line i-3 of bg fld "EnemyNames" end if put the random of (10*item 16 of line 1 of MDATA) into item 15 of line i of MDATA end repeat MakeLocs resetlocs hide cd fld id 10 hide cd fld id 7 hide cd fld id 15 hide cd btn id 8 hide cd btn id 13 hide cd btn id 12 hide cd btn id 9 end Init on StartFight --戦闘開始 send mouseup to cd btn id 8 end StartFight on UpdateField global MDATA,gcount put Trunc(item 3 of line gcount of MDATA)&&"/"&&Trunc(item 4 of line gcount of MDATA) into line gcount of bg fld "PartyHPs" put Trunc(item 5 of line gcount of MDATA)&&"/"&&Trunc(item 6 of line gcount of MDATA) into line gcount of bg fld "PartyMPs" end UpdateField on useTech what -- 特技使用を実行。 global gcount,gDchar,GTmagics if what is not empty then put line what of GTmagics into TECHDATA ToMP -1*(item 4 of TECHDATA) repeat with i=6 to number of items of TECHDATA send item i of TECHDATA to this card end repeat end if end useTech on BackDisp Dchar --攻撃を受けて後退 global MDATA,gDchar,gAtkFlg if Dchar is empty then put gDchar into Dchar put loc of cd btn id Dchar into btnLoc if Dchar <= 3 then put 20 into AdNum if line Dchar of gAtkFlg is not "Miss!" then set icon of cd btn id Dchar to (item 2 of line Dchar of MDATA)+41 playSnd 2 end if set loc of cd btn id Dchar to (item 1 of btnLoc)+AdNum,(item 2 of btnLoc) else if Dchar <= 6 then put -20 into AdNum if line Dchar of gAtkFlg is a number then playSnd 2 end if set loc of cd btn id Dchar to (item 1 of btnLoc)+AdNum,(item 2 of btnLoc) end if end BackDisp on BackReset Dchar --後退を戻す global MDATA,gDchar,GTBattleLocs if Dchar is empty then put gDchar into Dchar if Dchar <= 3 then if item 3 of line Dchar of MDATA > 0 then set icon of cd btn id Dchar to (item 2 of line Dchar of MDATA)+40 end if set loc of cd btn id Dchar to line Dchar of GTBattleLocs end BackReset on ShowSub OCharID--効果のボタンを見せます。 set icon of cd btn id 9 to 0 show cd btn id 9 at loc of cd btn id OCharID return 9 end ShowSub on MagicEffect which --魔法や特技などの発動、効果、二次的アニメ global gcount,gDchar DispIconEffect which,gcount,gDchar end MagicEffect on NormalAtk Ochar,Dchar,MagN,flg --通常攻撃 global gcount,gDchar,MDATA,gAtkFlg if Dchar is empty then put gDchar into Dchar else put Dchar into gDchar if Ochar is empty then put gcount into Ochar if MagN is empty then put 1 into MagN put line Ochar of MDATA into OcharDATA HiddenAtk1 MagN,0,Dchar,Ochar HiddenAtk2 (item 22 of OcharDATA),0,Dchar,Ochar end NormalAtk on MagicAtk1 MagN,Ochar,Dchar --汎用魔法攻撃サンドイッチ前部分 HiddenAtk1 MagN,2,Dchar,Ochar end MagicAtk1 on MagicAtk2 what,Ochar,Dchar --汎用魔法攻撃サンドイッチ後部分 HiddenAtk2 what,2,Dchar,Ochar end MagicAtk2 on gAtk1 MagN --全体物理攻撃前 gMAtk1 MagN,-2 end gAtk1 on gAtk2 what --全体物理攻撃後 global gcount,gDchar get gDchar put 9 into gDchar if it > 3 then put line 5 of bg fld "LocsDATA" into Cloc set loc of cd btn id 9 to Cloc DispIconMove what,gcount,9 repeat with i=4 to 6 put i into gDchar BackDisp i HiddenAtk2 0,0,i,gcount end repeat else put line 2 of bg fld "LocsDATA" into Cloc set loc of cd btn id 9 to Cloc DispIconMove what,gcount,9 repeat with i=1 to 3 put i into gDchar BackDisp i HiddenAtk2 0,0,i,gcount end repeat end if end gATk2 on gMAtk1 MagN,AddN --全体魔法攻撃前部分 global gcount,gDchar if gDchar > 3 then repeat with i=4 to 6 put i into gDchar HiddenAtk1 MagN,2+AddN,i,gcount end repeat else repeat with i=1 to 3 put i into gDchar HiddenAtk1 MagN,2+AddN,i,gcount end repeat end if end gMAtk1 on gMAtk2 what,AddN --全体魔法攻撃後部分 global gcount,gDchar if gDchar > 3 then repeat with i=4 to 6 put i into gDchar HiddenAtk2 what,2+AddN,i,gcount end repeat else repeat with i=1 to 3 put i into gDchar HiddenAtk2 what,2+AddN,i,gcount end repeat end if end gMatk2 on gSatk1 MagN,AddN global gcount,gDchar if gDchar > 3 then repeat with i=4 to 6 put i into gDchar ShokanAtk1 MagN,2+AddN,i,gcount end repeat else repeat with i=1 to 3 put i into gDchar ShokanAtk1 MagN,2+AddN,i,gcount end repeat end if end gSatk1 on ShokanAtk1 MagN,StOffset,Dchar,Ochar --召喚は相手の物理/魔法平均防御、回避を使う global gcount,gDchar,MDATA,gAtkFlg if Dchar is empty then put gDchar into Dchar else put Dchar into gDchar if Ochar is empty then put gcount into Ochar if MagN is empty then put 1 into MagN if item 3 of line Dchar of MDATA <= 0 then put empty into line Dchar of gAtkFlg else --攻撃がヒットしたら if the random of 100 < (100*item (11+2) of (line Ochar of MDATA)/((item 12 of line Dchar of MDATA)+(item 14 of line Dchar of MDATA))*2) then --ダメージ算出 put round(-MagN*((item (7+2) of line Ochar of MDATA)^2/((item 8 of line Dchar of MDATA)+(item 10 of line Dchar of MDATA))*2)) into line Dchar of gAtkFlg else --攻撃をミスったら put "Miss!" into line Dchar of gAtkFlg end if end if end ShokanAtk1 --統合攻撃ハンドラ。内部演算と画像表示が分離しており、魔法攻撃も統合したもの。 --StOffsetに2を入れると魔法攻撃、空なら物理攻撃 on HiddenAtk1 MagN,StOffset,Dchar,Ochar --特技などで使うサンドイッチの前部分 global gcount,gDchar,MDATA,gAtkFlg if Dchar is empty then put gDchar into Dchar else put Dchar into gDchar if Ochar is empty then put gcount into Ochar if MagN is empty then put 1 into MagN if item 3 of line Dchar of MDATA <= 0 then put empty into line Dchar of gAtkFlg else --攻撃がヒットしたら if the random of 100 < (100*item (11+StOffset) of (line Ochar of MDATA)/item (12+StOffset) of line Dchar of MDATA) then --ダメージ算出 put round(-MagN*((item (7+StOffset) of line Ochar of MDATA)^2/item (8+StOffset) of line Dchar of MDATA)) into line Dchar of gAtkFlg else --攻撃をミスったら put "Miss!" into line Dchar of gAtkFlg end if end if end HiddenAtk1 on HiddenAtk2 what,StOffset,Dchar,Ochar --特技などで使うサンドイッチの後ろ部分 global gcount,gDchar,MDATA,gAtkFlg if Dchar is empty then put gDchar into Dchar if Ochar is empty then put gcount into Ochar put line Ochar of MDATA into OcharDATA put line Dchar of MDATA into DcharDATA --攻撃画面処理 if line Dchar of gAtkFlg is not empty then if what > 0 then if StOffset is not 2 then dispIconMove what,OChar,Dchar else dispIconEffect what,OChar,Dchar end if if line Dchar of gAtkFlg is a number then gChange ToHP line Dchar of gAtkFlg gChange end if numdisp Dchar,line Dchar of gAtkFlg if item (30+StOffset) of DcharDATA is not empty and item 3 of DcharDATA > 0 then do item (30+StOffset) of DcharDATA checkST Dchar end if end HiddenAtk2 on numdisp btnID,enum -- ダメージ、回復など表示用。 --PlayBGM put enum into cd fld "numeffects" put loc of cd btn ID btnID into btnLoc set topleft of cd fld "numeffects" to (item 1 of btnLoc)-40,(item 2 of btnLoc)-28 show cd fld "numeffects" repeat with i=1 to 3 set topleft of cd fld "numeffects" to (item 1 of btnLoc)-40,(item 2 of btnLoc)-i^2-28 wait 1 end repeat wait 35 hide cd fld "numeffects" put empty into cd fld "numeffects" end numdisp on checkST Dchar,flg --勝ったかな? global MDATA,gcount,Gtag,gBGM,BGMDATA if Dchar is empty then put gcount into Dchar if item 3 of line Dchar of MDATA <=0 then --単体が死んだ if Dchar >= 4 then --敵やったら playSnd 4 lock screen hide cd btn id Dchar put empty into line Dchar-3 of bg fld "EnemyNames" unlock screen with dissolve else set icon of cd btn id Dchar to (item 2 of line Dchar of MDATA)+42 end if else BackReset Dchar end if --ゲームはどうなったか if (item 3 of line 1 of MDATA)+(item 3 of line 2 of MDATA)+(item 3 of line 3 of MDATA) <=0 then --負けた if ReadSubflg(2,2) is empty then if CondGlf(10) then send GoTop to window (line 3 of BGMDATA) else send GoTop to window (line 4 of BGMDATA) end if gameover else --負けるのがイベントだった pop card if Gtag is not empty then do Gtag exit to hypercard end if else if (item 3 of line 4 of MDATA)+(item 3 of line 5 of MDATA)+(item 3 of line 6 of MDATA) <=0 then WinFight endFight end if end checkST on WinFight global MDATA,gcount,GTconsItems,GTWeapItems,GTProtItems,GTAcceItems --見事に勝利 --経験値 put (item 20 of line 4 of MDATA)+(item 20 of line 5 of MDATA)+(item 20 of line 6 of MDATA) into Exp put 0 into MemN --頭数は? repeat with i=1 to 3 if first item of line i of MDATA is not empty then add 1 to MemN end repeat --金、アイテム put (item 35 of line 4 of MDATA)+(item 35 of line 5 of MDATA)+(item 35 of line 6 of MDATA) into Money put empty into SoItems repeat with i=1 to 3 put item 27 of line i+3 of MDATA into kind put item 28 of line i+3 of MDATA into what if kind is not empty then getItem kind,what get offset(RETURN&kind&","&what,RETURN&SoItems) put number of lines of char 1 to it of SoItems into LN if it is not 0 then add 1 to item 3 of line LN of SoItems else put kind&","&what&",1" into line (number of lines of SoItems)+1 of SoItems end if end repeat if Money > 0 then setflg 1,ReadFlg(1)+Money get "敵の所持金"&Money&"を手に入れた!"&RETURN&RETURN else get "敵の所持金は手に入らなかった!"&RETURN&RETURN if SoItems is not empty then put empty into TempDATA repeat with i=1 to number of lines of SoItems put item 1 of line (item 2 of line i of SoItems) of the value of (item (item 1 of line i of SoItems) of "GTconsItems,GTweapItems,GTprotItems,GTacceItems")~ into line i of TempDATA if (item 3 of line i of SoItems) > 1 then put " x"&(item 3 of line i of SoItems) after line i of TempDATA end repeat put "手に入れたアイテム:"&RETURN&RETURN&TempDATA after it else put "アイテムは手に入らなかった。" after it set height of cd fld id 15 to 16*(number of lines of it)+16 put it into cd fld id 15 -- 本番行きまーす PlaySnd 5 --レベルチェック show cd fld id 15 repeat with i=1 to 3 if item 3 of line i of MDATA > 0 then add round(Exp/MemN) to item 20 of line i of MDATA put round(100*(1.3)^(item 21 of line i of MDATA)) into REXP if (item 20 of line i of MDATA) >= REXP then --レベルアップだ numdisp i,"LEVEL UP!" subtract REXP from item 20 of line i of MDATA add 1 to item 21 of line i of MDATA multiply item 3 of line i of MDATA by 1.1 multiply item 5 of line i of MDATA by 1.1 else numdisp i,"Exp:"&round(Exp/MemN) end if end repeat wait 30 hidem end WinFight on endFight --逃げるにしても、勝ったにしても後始末 global MDATA,Gtag,gBGM,BGMDATA saveMDATA InitMDATA visual effect dissolve go cd "Black" visual effect iris open pop card --if item 1 of gBGM is empty then playBGM 2,0 if CondGlf(10) then send GoTop to window (line 3 of BGMDATA) send "Play" to window (line 1 of BGMDATA) else send GoTop to window (line 4 of BGMDATA) send "Play" to window (line 2 of BGMDATA) end if put empty into item 3 of line 8 of MDATA put "On" into item 4 of line 8 of MDATA if ReadSubFlg(2,2) is empty then if Gtag is not empty then do Gtag end if else gameover exit to hypercard end endFight --特技/アイテムハンドラからの呼び出し on Gchange --gcountとgDcharを入れ替える global gcount,gDchar get gcount put gDchar into gcount put it into gDchar end Gchange -- on InitOneChar i --単体だけを初期化する。変身、呼び寄せに使用 -- global gcount,MDATA -- put gcount into OldgCounnt -- --キャラステータス書き込み -- put line i of MDATA into line i of MDATA -- -- レベル加算 -- multiply item 4 of line i of MDATA by 1.1^((item 21 of line i of MDATA)-1) -- multiply item 6 of line i of MDATA by 1.1^((item 21 of line i of MDATA)-1) -- repeat with k=7 to 16 -- multiply item k of line i of MDATA by 1.05^(item 21 of line i of MDATA) -- end repeat -- --敵キャラの経験値、HPもレベルに応じて -- if 4<=i and i<= 6 then -- put item 4 of line i of MDATA into item 3 of line i of MDATA -- multiply item 20 of line i of MDATA by 1.05^(item 21 of line i of MDATA) -- end if -- --装備 -- put i into gcount -- if line i of MDATA is not empty then -- put the random of (10*item 16 of line 1 of MDATA) into item 15 of line i of MDATA -- if last char of (item 17 of line i of MDATA) is "*" then useitem (item 17 of line i of MDATA) -- if last char of (item 18 of line i of MDATA) is "*" then useitem (item 18 of line i of MDATA) -- if last char of (item 19 of line i of MDATA) is "*" then useitem (item 19 of line i of MDATA) -- end if -- show cd btn ID i -- if i<=3 then -- set icon of cd btn ID i to (item 2 of line i of MDATA)+51 -- put empty into line i of bg fld "PartyNames" -- put empty into line i of bg fld "PartyHPs" -- put empty into line i of bg fld "PartyMPs" -- put i into gcount -- if item 1 of line i of MDATA is not empty then -- put Translate(plName(i)) into line i of bg fld "PartyNames" -- put Trunc(item 3 of line i of MDATA)&&"/"&&Trunc(item 4 of line i of MDATA) into line i of bg fld "PartyHPs" -- put Trunc(item 5 of line i of MDATA)&&"/"&&Trunc(item 6 of line i of MDATA) into line i of bg fld "PartyMPs" -- end if -- else -- set icon of cd btn ID i to (item 2 of line i of MDATA) -- put Translate(plName(i)) into line i-3 of bg fld "EnemyNames" -- end if -- put OldgCounnt into gcount -- end InitOneChar on ChangeChar i,NewName --変身。敵キャラを念頭に置いている global MDATA,gCharsDATA --体力、魔力、レベル、ターン状況を保存 put item 3 of line i of MDATA into St3 put item 5 of line i of MDATA into St5 put item 15 of line i of MDATA into St15 put item 21 of line i of MDATA into St21 --名前を手がかりに、キャラをMDATAに引っ張ってくる if NewName is not empty then get number of lines of char 1 to offset(NewName,gCharsDATA) of gCharsDATA else put empty into line i of MDATA end if if it is not empty then put line (item 1 of it) of gCharsDATA into line i of MDATA --MDATAの該当部分をレンダリングする put St21 into item 21 of line i of MDATA InitOneChar i --体力、魔力、レベル、ターン状況を設定 put St3 into item 3 of line i of MDATA put St5 into item 5 of line i of MDATA put St15 into item 15 of line i of MDATA end ChangeChar on BallChange which --ブラック/ホワイトボールの相転移 global MDATA,gcount if which is b then --黒〜白 ChangeChar gcount,"ホワイトボール" else --白〜黒 ChangeChar gcount,"ブラックボール" end if end BallChange on CounterAtk --カウンターをぶちかます global gcount,gDchar,MDATA if item 3 of line gDchar of MDATA > 0 then if "CounterAtk" is not in item 30 of line gcount of MDATA then BackReset gChange NormalAtk gChange end if end if end CounterAtk on RikoBarst --利己の花 global MDATA,gcount,gDchar if item 3 of line gDchar of MDATA <= 0 then --発動! put empty into LvChars repeat with i=1 to 6 if item 3 of line i of MDATA > 0 then put i into item (number of items of LvChars)+1 of LvChars end repeat if LvChars is not empty then put gcount into Oldgcount put the round of (item 4 of line gDchar of MDATA)/3 into HealHP showm Translate("「利己の花」が発動した!") --削除する put empty into item 19 of line gDchar of MDATA put empty into item 19 of line gDchar of MDATA put empty into item 30 of line gDchar of MDATA put empty into item 32 of line gDchar of MDATA --よみがえる gChange BackReset ToHP HealHP HealEffect "+"&HealHP gChange --おしつける put any item of LvChars into gcount ToHP -HealHP playSnd "hit" numdisp gcount,"-"&HealHP hidem checkST gcount put Oldgcount into gcount end if end if end RikoBarst on AddBoxMoney global gcount,gDchar,MDATA if item 3 of line gDchar of MDATA > 0 then add 200 to item 35 of line gDchar of MDATA end AddBoxMoney on AddBoxItem global gcount,gDchar,MDATA,gItemsDATA if item 3 of line gDchar of MDATA > 0 then put item 1 of any line of gItemsDATA into item 34 of line gDchar of MDATA end AddBoxItem on ShokanHide --召喚を隠す global gcount lock screen if gcount < 4 then hide cd btn id 1 hide cd btn id 2 hide cd btn id 3 else hide cd btn id 4 hide cd btn id 5 hide cd btn id 6 end if unlock screen with dissolve fast end ShokanHide on ShokanDisp what --召喚を見せる global gDchar -- push cd -- put "1,2,3,4,5" into ShBNum -- sort items of ShBNum by the random of 500 -- go cd ("ShokanB"&item 1 of ShBNum) -- send ("ShokanDisp"&&what) to cd ("ShokanB"&item 1 of ShBNum) -- go cd ("ShokanB"&item 2 of ShBNum) -- send ("ShokanDisp"&&what) to cd ("ShokanB"&item 2 of ShBNum) -- pop cd put 12 into BtnID put item 2 of topleft of cd btn id BtnID into y if gDchar > 3 then set topleft of cd btn id BtnID to 25*20-60,y else set topleft of cd btn id BtnID to 0,y set name of cd btn id BtnID to what show cd btn id BtnID if gDchar > 3 then repeat with i=25 down to 1 get the ticks set topleft of cd btn id BtnID to i*20-60,y wait it-the ticks+2 end repeat else repeat with i=1 to 25 get the ticks set topleft of cd btn id BtnID to i*20-60,y wait it-the ticks+2 end repeat wait 20 hide cd btn id BtnID end ShokanDisp on ShokanShow --召喚後キャラ表示 global gcount,MDATA lock screen if gcount < 4 then repeat with i=1 to 3 if item 1 of line i of MDATA is not empty then show cd btn id i end repeat else repeat with i=4 to 6 if item 3 of line i of MDATA > 0 then show cd btn id i end repeat unlock screen with dissolve fast end ShokanShow on HealEffect what --回復効果を見せます global gcount playSnd 3 DispIconEffect 3,gcount,gcount BackReset gcount numdisp gcount,what end HealEffect on HealAll what global gDchar,gcount,MDATA get gDchar if gcount < 4 then repeat with gcount=1 to 3 if item 1 of line gcount of MDATA is not empty then ToHP what HealEffect "+"&what end if end repeat else repeat with gcount=4 to 6 if item 3 of line gcount of MDATA > 0 then ToHP what HealEffect "+"&what end if end repeat put it into gDchar end HealAll on HealM what --単体回復 global gcount if gcount > 3 then ToHP what HealEffect "+"&what else gchange ToHP what HealEffect "+"&what gchange end if end HealM on MuscleWave wh global gcount,gDchar get gDchar set loc of cd btn id 9 to 240,120 set loc of cd btn id 12 to 190,120 set name of cd btn id 12 to item wh of "MuscleWave,HealWave" put 9 into gDchar SuperJump item wh of "1361,1360" wait item wh of "0,60" put it into gDchar play "shot" show cd btn id 12 wait 3 set loc of cd btn id 12 to 170,120 wait 3 set loc of cd btn id 12 to 150,120 lock screen hide cd btn id 12 set icon of cd btn id gcount to 0 unlock screen with dissolve end MuscleWave on ThrowSnd what playsnd what show cd btn id 9 end throwsnd --内部ユーティリティ on SaveLocs --戦闘キャラの位置を保存 repeat with i=1 to 6 put loc of cd btn id i into line i of bg fld "LocsDATA" end repeat end SaveLocs on ResetLocs --戦闘キャラの位置を戻す global GTBattleLocs repeat with i=1 to 6 set loc of cd btn id i to line i of GTBattleLocs end repeat end ResetLocs on SpellPose flg --魔法を詠唱する global gCount,MDATA if gCount < 4 or flg is not empty then set icon of cd btn id gCount to (48+item 2 of line gCount of MDATA) MagicEffect 1 set icon of cd btn id gCount to (49+item 2 of line gCount of MDATA) else MagicEffect 1 end if end SpellPose on StandPose flg --通常アイコンにする global gCount,MDATA if gCount < 4 or flg is not empty then set icon of cd btn id gCount to (40+item 2 of line gCount of MDATA) end if end StandPose on MakeLocs --パーティー人数にあわせて位置をきめる global GTBattleLocs,MDATA get bg fld "LocsDATA" put it into GTBattleLocs if item 1 of line 2 of MDATA is empty then put line 2 of it into line 1 of GTBattleLocs else if item 1 of line 3 of MDATA is empty then put the round of (((item 1 of line 1 of it)+(item 1 of line 2 of it))/2) into item 1 of line 1 of GTBattleLocs put the round of (((item 2 of line 1 of it)+(item 2 of line 2 of it))/2) into item 2 of line 1 of GTBattleLocs put the round of (((item 1 of line 2 of it)+(item 1 of line 3 of it))/2) into item 1 of line 2 of GTBattleLocs put the round of (((item 2 of line 2 of it)+(item 2 of line 3 of it))/2) into item 2 of line 2 of GTBattleLocs end if if item 1 of line 5 of MDATA is empty then put line 5 of it into line 4 of GTBattleLocs put 1 into line 7 of GTBattleLocs else if item 1 of line 6 of MDATA is empty then put the round of (((item 1 of line 4 of it)+(item 1 of line 5 of it))/2) into item 1 of line 4 of GTBattleLocs put the round of (((item 2 of line 4 of it)+(item 2 of line 5 of it))/2) into item 2 of line 4 of GTBattleLocs put the round of (((item 1 of line 5 of it)+(item 1 of line 6 of it))/2) into item 1 of line 5 of GTBattleLocs put the round of (((item 2 of line 5 of it)+(item 2 of line 6 of it))/2) into item 2 of line 5 of GTBattleLocs put 2 into line 7 of GTBattleLocs else put 3 into line 7 of GTBattleLocs end if end MakeLocs on FaceTo BtnID,targetID --キャラをキャラへ向ける if BtnID is targetID then exit faceto get ((icon of cd btn id BtnID) div 100 )*100 put loc of cd btn id BtnID into myLoc put loc of cd btn id targetID into herLoc if abs((item 1 of herLoc)-(item 1 of myLoc)) > abs((item 2 of herLoc)-(item 2 of myLoc)) then if (item 1 of herLoc)-(item 1 of myLoc) > 0 then put 30 into which else put 20 into which end if else if (item 2 of herLoc)-(item 2 of myLoc) > 0 then put 10 into which else put 40 into which end if end if -- set icon of cd btn id BtnID to it*100+which-1 set icon of cd btn id BtnID to it*100+which put ((item 1 of herLoc)-(item 1 of myLoc))*0.1+(item 1 of myLoc) into x put ((item 2 of herLoc)-(item 2 of myLoc))*0.1+(item 2 of myLoc) into y set loc of cd btn id BtnID to the round of x,the round of y end FaceTo function NeededMP what global gTechsDATA get number of lines of char 1 to offset(what,gTechsDATA) of gTechsDATA if it is not empty then put line (item 1 of it) of gTechsDATA into TECHDATA return word 2 of item 2 of TECHDATA end NeededMP on sendm what --メッセージ表示:戦闘用 showm what wait 30 hidem what end sendm on showm what --表示だけ put what into cd fld "MsgFld" show cd fld "MsgFld" end showm on hidem --隠すだけ hide cd fld "MsgFld" end hidem on updateScriptIndex --スクリプトインデックスを更新 set script of this bg to MakeScriptIndex(script of this bg,On,On) end updateScriptIndex