on SetFlg flgID,what --旧フラグ設定用(1-20,内容) global MDATA if flgID is not empty then put what into line 6+flgID of MDATA end SetFlg function ReadFlg flgID --旧フラグ参照(1-20) global MDATA return line 6+flgID of MDATA end ReadFlg on SetSubFlg SubflgID,flgID,what --旧サブフラグ設定用(無限,1-20,内容) global MDATA if flgID is not empty and SubflgID is not empty then put what into item SubflgID of line 6+flgID of MDATA end SetSubFlg function ReadSubFlg SubflgID,flgID --旧サブフラグ参照(無限,1-20) global MDATA return item SubflgID of line 6+flgID of MDATA end ReadSubFlg function BooleFlg FlgID,FlgSet --ブールフラグを読む global MDATA get item FlgSet of line 21 of MDATA if length of it < FlgID then return false else return item (char FlgID of it)+1 of "false,true" end if end BooleFlg on SetBooleFlg FlgID,FlgSet,what --ブールフラグを書き込む global MDATA get item FlgSet of line 21 of MDATA if length of it < FlgID then repeat (FlgID-(length of it)) put "0" after item FlgSet of line 21 of MDATA end repeat end if put (length of (not what))-4 into char FlgID of item FlgSet of line 21 of MDATA end SetBooleFlg on SetStoryFlg what --ストーリー進行度を書き込む global MDATA if what is a number then put what into item 1 of line 22 of MDATA end if end SetStoryFlg on ShowCard what push cd go cd what wait until the mouse is up wait until the mouse is down wait until the mouse is up pop cd end ShowCard --condシリーズ:条件判断用 function condFlg what --フラグがオンか return BooleFlg(what,1) end condFlg function condGlf what --フラグがオフか return not BooleFlg(what,1) end condGlf function condStr St,En --ストーリーが範囲内か global MDATA if En is empty then return ((item 1 of line 22 of MDATA) >= St) else if St is empty then return ((item 1 of line 22 of MDATA) < En) else return ((St <= (item 1 of line 22 of MDATA)) and ((item 1 of line 22 of MDATA)< En)) end if end condStr function condMap what --状態がwhatか global GTmapTemp return (item 1 of GTmapTemp is what) end condMap function condChr what --キャラがパーティーにいるか global MDATA return ((","&what&",") is in (","&(line (8+line 11 of MDATA) of MDATA)&",")) end condChr function condRhc what --キャラがパーティーにいないか global MDATA return ((","&what&",") is not in (","&(line (8+line 11 of MDATA) of MDATA)&",")) end condRhc function condItm what --ある消費アイテムを持っているか get line 27 to (the number of lines of MDATA) of MDATA return (("1,"&what&",") is in it) end condItm function cond1st get (number of the target)-(number of cd 1 of bg id 4056)+1 if it < 1 then return false return not BooleFlg(it,3) end cond1st function condBtl global MDATA return item 4 of line 8 of MDATA is not empty end condBtl --抽象基盤 on InitMDATA Sn --MDATA初期化 引き数を渡すとそのキャラだけ --MDATAの作業用領域にデータを展開する、システムの要 --FF NEXTまでは作業用にCDATAが存在したがノついに廃止 global gcount,MDATA,GTmainChars if Sn is empty then put 1 into Sn put 3 into En else put Sn into En repeat with i=Sn to En --デフォルトステータス書き込み get item i of line (8+line 11 of MDATA) of MDATA if it is not empty then put line it of GTmainChars into line i of MDATA --変数復帰 put item it*13-12 to it*13 of line 12 of MDATA into SVD if item 2 of SVD is not empty then repeat with j=2 to 8 --13 if j > 8 and item j of SVD is empty then exit repeat put item j of SVD into item (item j of "1,3,5,20,21,17,18,19,38,39,40,41,42") of line i of MDATA end repeat 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) else 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) put item 4 of line i of MDATA into item 3 of line i of MDATA put item 6 of line i of MDATA into item 5 of line i of MDATA end if -- レベル加算 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 --装備効果 put i into gcount if item 1 of line i of MDATA is not empty then if (item 17 of line i of MDATA) is not empty then useitem 2,(item 17 of line i of MDATA) if (item 18 of line i of MDATA) is not empty then useitem 3,(item 18 of line i of MDATA) if (item 19 of line i of MDATA) is not empty then useitem 4,(item 19 of line i of MDATA) end if else put empty into line i of MDATA end repeat end InitMDATA on SaveMDATA --変数のみ保存領域に global MDATA get line (8+(line 11 of MDATA)) of MDATA repeat with i=1 to number of items of it if item i of it is a integer then put empty into SVD repeat with j=2 to 13 put item (item j of "1,3,5,20,21,17,18,19,38,39,40,41,42") of line i of MDATA into item j of SVD end repeat put (item i of it)*13-12 into SN put (item i of it)*13 into EN put empty into item EN of line 12 of MDATA put SVD into item SN to EN of line 12 of MDATA end if end repeat end SaveMDATA on useitem kind,what -- アイテム使用を実行 global GTconsItems,GTweapItems,GTprotItems,GTacceItems get line what of the value of (item kind of "GTconsItems,GTweapItems,GTprotItems,GTacceItems") if it is not empty then repeat with i=6 to number of items of it send item i of it to this card end repeat end if end useitem on deleteitem kind,what --指定したアイテムを削除する global MDATA if kind is empty then exit deleteitem get offset((RETURN&kind&","&what&","),RETURN&(line 27 to (number of lines of MDATA) of MDATA)) if it is 0 then return "No Item" else put (number of lines of char 1 to it of line 27 to (number of lines of MDATA) of MDATA)+26 into LN if item 3 of line LN of MDATA > 1 then subtract 1 from item 3 of line LN of MDATA else delete line LN of MDATA end if end deleteitem on getitem kind,what,howmany --アイテムを追加する global MDATA if what is empty then exit getitem if howmany < 1 then put 1 into howmany get offset((RETURN&kind&","&what&","),RETURN&(line 27 to (number of lines of MDATA) of MDATA)) put (number of lines of char 1 to it of line 27 to (number of lines of MDATA) of MDATA)+26 into LN if it is 0 then put number of lines of MDATA into it2 if it2 < 26 then put 26 into it2 put kind&","&what&","&howmany into line it2+1 of MDATA sort lines of line 27 to it2+1 of MDATA --descending by item 1 of each else add howmany to item 3 of line LN of MDATA end getitem on deletechar who --パーティーからキャラを外す global MDATA get line 11 of MDATA repeat with i=1 to the number of items of line (8+it) of MDATA if item i of line (8+it) of MDATA is who then delete item i of line (8+it) of MDATA initMDATA saveMDATA exit repeat end if end repeat end deletechar on addchar who --パーティーにキャラを加える global MDATA get line 11 of MDATA if ","&who&"," is in ","&(line (8+it) of MDATA)&"," then exit addchar if the number of items of line (8+it) of MDATA > 2 then exit addchar put who into item (1+ the number of items of line (8+it) of MDATA) of line (8+it) of MDATA initMDATA saveMDATA end addchar on FlipParty global MDATA put 3-(line 11 of MDATA) into line 11 of MDATA initMDATA saveMDATA end FlipParty on savegame --保存する global ToSaveDATA,MDATA push card if there is a cd btn "Cast0" then put loc of cd btn "Cast0" into aLoc put icon of cd btn "Cast0" into PLicon else put "0,0" into aLoc put 0 into PLicon end if get MDATA repeat with i=1 to 6 put empty into line i of it end repeat put last word of id of this cd&RETURN&PLicon&RETURN&aLoc&RETURN&it into ToSaveDATA put "ゲームを保存する場所をクリックして下さい。" into cd fld 1 of cd "saveCARD" put "Save Game" into cd fld id 13 of cd "saveCARD" visual effect stretch from bottom fast go cd "saveCARD" end savegame on FightTo En1,En2,En3,Lv1,Lv2,Lv3,tag,CdName --戦闘導入の処理 --Enは敵キャラ番号、tagは終了時に呼び出すハンドラ、Lvは敵のレベル global MDATA,Gtag,GTenemyChars,BGMDATA -- if ReadSubFlg(1,2) is empty then exit FightTo lock screen put ","&En2&","&En3 after En1 put ","&Lv2&","&Lv3 after Lv1 if En1 is ",," then exit FightTo repeat with i=3 down to 1 if item i of En1 is empty then delete item i of En1 delete item i of Lv1 end if end repeat put tag into Gtag if CdName is empty or there is not a cd CdName of bg id 10697 then put 1 into CdName push card repeat with i=4 to 6 if item i-3 of En1 > 0 then put item (i-3) of Lv1 into Lv put line (item (i-3) of En1) of GTenemyChars into line i of MDATA multiply item 4 of line i of MDATA by 1.1^(Lv-1) multiply item 6 of line i of MDATA by 1.1^(Lv-1) multiply item 20 of line i of MDATA by 1.1^(Lv-1) repeat with k=7 to 16 multiply item k of line i of MDATA by 1.05^(Lv-1) end repeat put item 4 of line i of MDATA into item 3 of line i of MDATA put item 6 of line i of MDATA into item 5 of line i of MDATA else put empty into line i of MDATA end if end repeat PlaySnd 1 --play JustMeet go cd "white" unlock screen with dissolve visual effect dissolve go cd "Black" lock screen go cd CdName of bg id 10697 --playBGM 1,0 send "GoTop" to window (line 1 of BGMDATA) send "Play" to window (line 2 of BGMDATA) send "Init" to cd CdName of bg id 10697 unlock screen with iris open send "StartFight" to cd CdName of bg id 10697 end FightTo --装備の強制変更 on ChangeTool2 who,toolNumber,what --装備を変更し、ステータスに反映させる  global MDATA,gcount,GTNowTools  if ((0 0 then wait it-(the ticks)+(item 4 of Frm) end repeat end DispIconMove on DispIconEffect what,OCharID,DcharID --アイコンアニメ:効果を担当 global GTiconEffects put line (what)*10-9 to (what)*10 of GTiconEffects into Seq put loc of cd btn id OCharID into OcharLoc send "ShowSub OCharID" to this cd put the result into OCharID put loc of cd btn id DcharID into DcharLoc repeat with i=1 to 20 get the ticks put line i of Seq into Frm if item 3 of Frm is empty then exit repeat put ((item 1 of DcharLoc)-(item 1 of OcharLoc))*(item 5 of Frm) div 100+(item 1 of OcharLoc)+item 6 of Frm into x put ((item 2 of DcharLoc)-(item 2 of OcharLoc))*(item 5 of Frm) div 100+(item 2 of OcharLoc)+item 7 of Frm into y set icon of cd btn id OcharID to (item 3 of Frm) set loc of cd btn id OcharID to x,y if item 8 of Frm is not empty then send (item 8 of Frm) to this card if item 4 of Frm > 0 then wait it-(the ticks)+(item 4 of Frm) end repeat hide cd btn id OcharID set icon of cd btn id OCharID to 0 end DispIconEffect on SubMove what global gcount,gDchar DispIconEffect what,gcount,gDchar end SubMove on SubEffect what global gcount,gDchar DispIconEffect what,gcount,gDchar end SubEffect -- on PlaySnd what --即時サウンド global GTsnds get line what of GTsnds if it is not empty then play stop do "play"&&it end if end PlaySnd on DispTextPut what --イベントからオープニング風のテキスト表示を put what into line (1+number of lines of cd fld 1 of cd "DispText") of cd fld 1 of cd "DispText" end DispTextPut on DispTextGo what --実行 if what is empty then if cd fld 1 of cd "DispText" is empty then exit DispTextGo else put cd fld 1 of cd "DispText" into what end if push card lock screen go cd "DispText" if the optionkey is up then put empty into cd fld 1 unlock screen with dissolve wait 30 repeat with i=1 to number of lines of what lock screen put line i of what into line i of cd fld 1 unlock screen with dissolve wait 40 end repeat wait 60 lock screen put empty into cd fld 1 end if unlock screen with dissolve visual dissolve fast go cd "White" visual dissolve fast pop card end DispTextGo on GameOver --ゲームオーバー get line 2 of bg fld 1 of cd "TimpaniDATA" of bg id 5549 lock screen go cd "DispText" if the optionkey is up then put empty into cd fld 1 unlock screen with dissolve wait 30 repeat with i=1 to number of lines of it lock screen put line i of it into line i of cd fld 1 unlock screen with dissolve wait 40 end repeat wait 60 lock screen put empty into cd fld 1 end if unlock screen with dissolve visual dissolve fast go cd "White" visual dissolve fast go cd "Title" exit to hypercard end GameOver on Ending --エンディング get bg fld 1 of cd "EndingDATA" lock screen go cd "DispText2" put it into cd fld 1 set scroll of cd fld 1 to 30000 set style of cd btn id 2 to opaque unlock screen put scroll of cd fld 1 into SC set scroll of cd fld 1 to 0 set style of cd btn id 2 to transparent repeat with i=0 to SC get the ticks set scroll of cd fld 1 to i if the mouse is up then wait until the ticks - it -2 >=0 else add 12 to i end repeat wait 50 lock screen put empty into cd fld 1 unlock screen with dissolve visual dissolve fast go cd "White" visual dissolve fast go cd "Title" end Ending ######################################## --FF extra時代からの遺産、アイテム/装備/魔法効果の記述用ハンドラ群 --いいかげんもちっといい方法を導入してくれい>自分 on ToName what --名前 1 ReplaceST what,1 end ToName on ToPict what --画像 2 ReplaceST what,2 end ToPict on ToHP what --体力 3 global gcount,MDATA -- if what > 0 then put what+item 3 of line gcount of MDATA into a1 if a1 > item 4 of line gcount of MDATA then ReplaceST the trunc of (item 4 of line gcount of MDATA),3 else if a1 <0 then ReplaceST 0,3 else ReplaceST the trunc of a1,3 if gcount <=3 then send "UpdateField" to this cd end if end ToHP on ToHP2 what --体力乗算 3 ReMultiplyST what,3 end ToHP2 on ToMaxHP what --最大体力 4 ReMultiplyST what,4 end ToMaxHP on ToMP what --集中力 5 global gcount,MDATA put what+item 5 of line gcount of MDATA into a1 if a1 > item 6 of line gcount of MDATA then ReplaceST item 6 of line gcount of MDATA,5 else if a1 <0 then Return "NEMP" exit ToMP else ReplaceST a1,5 if gcount <=3 then send "UpdateField" to this cd end if end ToMP on ToMP2 what --魔力乗算 5 ReMultiplyST what,5 end ToMP2 on ToMaxMP what --最大集中力 6 ReMultiplyST what,6 end ToMaxMP on ToAP what --物理攻撃力 7 ReMultiplyST what,7 end ToAP on ToGP what --物理防御力 8 ReMultiplyST what,8 end ToGP on ToMAP what --魔法攻撃力(不使用) 9 ReMultiplyST what,9 end ToMAP on ToMGP what --魔法防御力(不使用) 10 ReMultiplyST what,10 end ToMGP on ToHitPar what --物理攻撃命中率 11 ReMultiplyST what,11 end ToHitPar on ToAvoidPar what --物理攻撃回避率 12 ReMultiplyST what,12 end ToAvoidPar on ToMagicHitPar what --魔法攻撃命中率(不使用) 13 ReMultiplyST what,13 end ToMagicHitPar on ToMagicAvoidPar what --魔法攻撃回避率(不使用) 14 ReMultiplyST what,14 end ToMagicAvoidPar on ToTTA what --攻撃準備時間 15 ReAddST what,15 end ToTTA on ToTTASpeed what --攻撃準備時間のスピード 16 ReMultiplyST what,16 end ToTTASpeed on ToItem1 what --装備武器 17 end ToItem1 on ToItem2 what --装備防具 18 end ToItem2 on ToItem3 what --その他の装備 19 end ToItem3 on ToEXP what --経験値 20 ReAddST what,20 end ToEXP on ToLEVEL what --レベル 21 ReAddST what,21 end ToLEVEL on ToAtGrp what --攻撃時発動1(グラフィック) 22 ReplaceST what,22 end ToAtGrp on ToAtHnd what --攻撃時発動2(ハンドラ) 23 ReplaceST2 what,23 end ToAtHnd on ToMgGrp what --魔法時発動1(グラフィック) 24 ReplaceST what,24 end ToMgGrp on ToMgHnd what --魔法時発動2(ハンドラ) 25 ReplaceST2 what,25 end ToMgHnd on ToStGrp what --登場時発動1(グラフィック) 26 ReplaceST what,26 end ToStGrp on ToStHnd what --登場時発動2(ハンドラ) 27 ReplaceST2 what,27 end ToStHnd on ToEnGrp what --退散時発動1(グラフィック) 28 ReplaceST2 what,28 end ToEnGrp on ToEnHnd what --退散時発動2(ハンドラ) 29 ReplaceST2 what,29 end ToEnHnd on ToGdHnd what --防御時発動(ハンドラ) 30 ReplaceST2 what,30 end ToGdHnd on ToSp10 what --予約 31 ReplaceST2 what,31 end ToSp10 on ToMGdHnd what --魔法防御時発動(ハンドラ) 32 ReplaceST2 what,32 end ToMGdHnd on ToSp12 what --予約 33 ReplaceST2 what,33 end ToSp12 on ToTech what --特技の羅列 38〜 global gcount,MDATA if ","&what&"," is in ","&(item 37 to (number of items of line gcount of MDATA) of line gcount of MDATA)&"," then exit ToTech put number of items of line gcount of MDATA into ITnum if ITnum < 37 then put 37 into ITnum put what into item ITnum+1 of line gcount of MDATA end ToTech on ReplaceST what,Num --置き換え global gcount,MDATA put what into item Num of line gcount of MDATA end ReplaceST on ReplaceST2 what,Num --空ならば置き換え global gcount,MDATA if item Num of line gcount of MDATA is empty then put what into item Num of line gcount of MDATA end if end ReplaceST2 on ReAddST what,Num --足す global gcount,MDATA Add what to item Num of line gcount of MDATA end ReAddST on ReMultiplyST what,Num --かける global gcount,MDATA put (item (Num) of line (gcount) of MDATA)*what into item (Num) of line (gcount) of MDATA end ReMultiplyST on UpdateField end UpdateField on charJump gBn,what --キャラを可愛くジャンプ! global gcount if gBn is empty then put gcount into gBn if what is empty then put 1 into what put loc of cd btn id gBn into plLoc put "0,12,18,21,22,21,18,12,0" into JumpDATA repeat what repeat with i=1 to 9 get the ticks set loc of cd btn id gBn to (item 1 of plLoc),(item 2 of plLoc)-(item i of JumpDATA) wait it-the ticks+1 end repeat end repeat set loc of cd btn id gBn to plLoc end charJump on SuperJump AfterIcon --キャラが異常なジャンプ! global gcount,gDchar put icon of cd btn id gcount into OldIcon put loc of cd btn id gcount into plLoc put loc of cd btn id gDchar into plLoc2 put (item 1 of plLoc2)-(item 1 of plLoc) into dx put (item 2 of plLoc2)-(item 2 of plLoc) into dy repeat with i=1 to 7 get the ticks set loc of cd btn id gcount to round(dx/14*i)+(item 1 of plLoc),round(dy/14*i)+(item 2 of plLoc)-(i*2)^2 wait (1+it-the ticks) end repeat wait 20 set icon of cd btn id gcount to OldIcon+AfterIcon repeat with i=7 down to 1 get the ticks set loc of cd btn id gcount to round(dx/14*(15-i))+(item 1 of plLoc),round(dy/14*(15-i))+(item 2 of plLoc)-(i*2)^2 wait (1+it-the ticks) end repeat end SuperJump on Arrowkey if the userlevel < 3 then if (the textArrows) and (the selectedfield is not empty) then pass Arrowkey end if else pass Arrowkey end Arrowkey on CloseStack UxMovie "CloseAll" end CloseStack