2018年 2月21日
まずとりあえずグチャグチャだったエフェクトのプログラムを整理した。
もちろん表示自体はなんら変わらない。
それではサクサクとソースを。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
#deffunc efsx ; 座標x if efsn2<=3 : ef(efg+6)=bcx1(efsn2)+40 ; x if efsn2>=4 : ef(efg+6)=bcx2(efsn2-3)+40 ; x return #deffunc efsm int efsmf ; 向き repeat 1 if efsmf=1 : eff(efg2+0)*=1.0 : eff(efg2+1)*=1.0 : break ; 正 if efsmf=2 : eff(efg2+0)*=-1.0 : eff(efg2+1)*=1.0 : break ; 左右反転 if efsmf=3 : eff(efg2+0)*=1.0 : eff(efg2+1)*=-1.0 : break ; 上下反転 if efsmf=4 : eff(efg2+0)*=-1.0 : eff(efg2+1)*=-1.0 : break ; 全反転 loop if efsn2<=3 : eff(efg2+0)*=-1.0 ; 左の隊の場合の反転 return #deffunc efs int efsf,int efsn1,int efsn3,int efsd,int efsa,int efse,int efsox,int efsoy ; int efsx,int efsy,int dfsr,int dfsrn ; エフェクトセット(フラグ、グラ、速さ、反転、移動時間、透明か加算か、大きさx、大きさy); 動きx、動きy、回転、回転速度) if efsf=0 : return f=0 repeat efb ; No,ピック if ef(efd*cnt)=0 : efg=efd*cnt : efg2=4*cnt : f=1 : break loop if f=0 : return ; 空きが無い ef(efg)=efsf ; 表示種類 ef(efg+1)=efsn1 ; グラNo. ;ef(efg+2)=efsn2 ; 表示場所 ef(efg+3)=0 ; アニメカウント ef(efg+4)=0 ; アニメ速さカウント ef(efg+5)=efsn3 ; アニメ速さ ef(efg+6)=0 ; x ef(efg+7)=btly1+65 ; y ef(efg+8)=0 ; 動きx ef(efg+9)=0 ; 動きy ef(efg+10)=efse ; 表示種類(0=通常、1=加算) ef(efg+11)=efsa ; 移動時間 repeat 4 eff(efg2+cnt)=0.0 ; リセット loop switch efsf ; 表示種類 case 1 ; 自分固定 if fs=1 : efsn2=ut : else : efsn2=ut+3 ; 場所x swbreak case 2 ; 敵固定 if fs=1 : efsn2=et+3 : else : efsn2=et ; 場所x swbreak case 3 ; 投射 if fs=1 : efsn2=ut : else : efsn2=ut+3 ; 場所x n=ut+et-1 : ef(efg+8)=(btlxk*n+btlck)/efsa : if fs=2 : ef(efg+8)*=-1 ; 距離とスピード swbreak case 4 ; 敵全体投射 if fs=1 : efsn2=4 : else : efsn2=1 ; 場所x ef(efg+8)=(btlxk*3)/efsa : if fs=2 : ef(efg+8)*=-1 ; 距離とスピード swbreak case 5 ; 味方全体 if fs=1 : efsn2=2 : else : efsn2=5 ; 場所x swbreak case 6 ; 敵全体 if fs=1 : efsn2=5 : else : efsn2=2 ; 場所x swbreak case 7 ; 召還 if fs=1 : efsn2=smn : else : efsn2=smn+3 ; 場所x swbreak case 8 ; リザレクション if fs=1 : efsn2=rt : else : efsn2=rt+3 ; 場所x swbreak swend efsx ; x if efsox=0 : eff(efg2+0)=1.0 : else : eff(efg2+0)=1.0*double(efsox)/10.0 ; 大きさ修正x if efsoy=0 : eff(efg2+1)=1.0 : else : eff(efg2+1)=1.0*double(efsoy)/10.0 ; 大きさ修正y efsm efsd ; 向き ; 回転 if btsn=5 : if efsn2<=3 : eff(efg2+2)=0.6 : else : eff(efg2+2)=-0.6 ; 曲刀 if btsn=6 : if efsn2<=3 : eff(efg2+2)=-0.3 : else : eff(efg2+2)=0.3 ; 刺突剣 if btsn=8 : if efsn2<=3 : eff(efg2+2)=-0.9 : else : eff(efg2+2)=0.9 ; 大剣 if btsn=11 : if efsn2<=3 : eff(efg2+2)=0.6 : else : eff(efg2+2)=-0.6 ; 槌 if btsn=15 : if efsn2<=3 : eff(efg2+2)=1.6 : else : eff(efg2+2)=-1.6 ; 大砲 if btsf2=10 : if efsn2<=3 : eff(efg2+2)=1.6 : else : eff(efg2+2)=-1.6 ; フャイヤー if btsf2=14 : if efsn2<=3 : eff(efg2+2)=0.6 : else : eff(efg2+2)=-0.6 ; フレイムアロー if btsf2=20 : if efsn2<=3 : eff(efg2+2)=-1.5 : else : eff(efg2+2)=1.5 ; アイスニードル if btsf2=21 : if efsn2<=3 : eff(efg2+2)=1.6 : else : eff(efg2+2)=-1.6 ; ウォーターストリーム if btsf2=24 { ; アイスジャベリン if efsn2<=3 : eff(efg2+2)=-1.6 : else : eff(efg2+2)=1.6 ef(efg+3)=10 : ef(efg+11)=30 ; グラ途中から } if btsf2=25 : eff(efg2+2)=-1.7 : eff(efg2+2)=1.7 ; アイスピラー if btsf2=28 : ef(efg+7)+=24 ; メイルシュトローム if btsf2=37 { ; ライトニングボルト if efsn2<=3 : eff(efg2+2)=1.6 : else : eff(efg2+2)=-1.6 } if btsf2=38 { ; ウィンドストーム if fs=1 : ef(efg+6)-=60 : else : ef(efg+6)+=60 ; x } if btsf2=40 : ef(efg+7)-=20 ; アースキュア if btsf2=42 : ef(efg+7)-=15 ; ネイチャーヒール if btsf2=46 : if efsn2<=3 : eff(efg2+2)=1.6 : else : eff(efg2+2)=-1.6 ; ストーンブラスト if btsf2=57 : if efsn2<=3 : eff(efg2+2)=1.6 : else : eff(efg2+2)=-1.6 ; サイキックフォース if btsf2=59 : ef(efg+6)-=1 : ef(efg+7)-=60 ; ホーリーライトサークル if btsf2=60 : ef(efg+7)-=10 ; レイブレイド if btsf2=92 : ef(efg+7)-=40 ; スタン if btsf2=105 or btsf2=106 { ; ファイヤーブレス、コールドブレス if fs=1 : eff(efg2+2)=1.5 : ef(efg+6)-=20 if fs=2 : eff(efg2+2)=-1.5 : ef(efg+6)+=20 } if btsf2=108 { ; 咆哮 if fs=1 : ef(efg+6)-=60 : else : ef(efg+6)+=60 ; x } if btsf2=110 { ; ポイズンブレス if fs=1 : ef(efg+6)-=60 : else : ef(efg+6)+=60 ; x } return #deffunc efp ; エフェクトプット repeat efb efg=efd*cnt : efg2=4*cnt ; データの先頭 if ef(efg)=0 : continue ; 無い ef(efg+4)+ : if ef(efg+4)>=ef(efg+5) : ef(efg+3)+ : ef(efg+4)=0 : ; アニメウエイト処理 if ef(efg+10)=0 : gmode 3,,,255 : else : gmode 5,,,255 ; 透明、加算 pos ef(efg+6),ef(efg+7) celput efw(ef(efg+1)),ef(efg+3),eff(efg2+0),eff(efg2+1),eff(efg2+2) if ef(efg+3)>=efga(ef(efg+1)) : ef(efg)=0 : break ; アニメ if ef(efg+3)<=ef(efg+11) : ef(efg+6)+=ef(efg+8) ; 動きx ef(efg+7)+=ef(efg+9) ; 動きy eff(efg2+2)+=eff(efg2+3) ; 回転 loop return #deffunc bts int btsf ; 魔法 btsn=0 : btsf2=btsf ; 種類 switch btsf case 1 ; 素アタック if us=6 or us=11 or us=13 or us=33 or us=36 or us=46 or us=51 or us=72 or us=74 or us=97 or us=111 or us=167 or us=181 or us=185 or us=205 : btsn=1 if us=71 or us=92 or us=96 or us=118 or us=132 or us=184 : btsn=2 if us=7 or us=16 or us=52 or us=135 or us=168 : btsn=3 if us=1 or us=8 or us=12 or us=32 or us=35 or us=43 or us=50 or us=73 or us=94 or us=95 or us=112 or us=120 or us=151 or us=152 or us=153 or us=169 or us=183 or us=190 or us=192 : btsn=4 if btsn=0 : efs 2,1,2,1,0,0 : swbreak ; 素手 if btsn=1 : efs 2,3,2,1,0,0 : swbreak ; 牙 if btsn=2 : efs 2,2,2,2,0,0 : swbreak ; 爪 if btsn=3 : efs 2,4,2,2,0,0 : swbreak ; 尾 if btsn=4 : efs 2,9,2,1,0,0 : swbreak ; 体当たり swbreak case 2 ; 近接武器アタック if itn=10 or itn=11 or itn=16 or itn=24 : btsn=5 : efs 2,5,1,1,0,0 : swbreak ; 曲刀 if itn=12 or itn=15 or itn=23 : btsn=6 : efs 2,7,2,2,0,0 : swbreak ; 刺突剣 if id(ig+19)=1 : btsn=7 : efs 2,15,2,2,0,0 : swbreak ; 剣 if id(ig+19)=2 : btsn=8 : efs 2,11,2,1,0,0 : swbreak ; 大剣 if id(ig+19)=3 : btsn=9 : efs 2, 8,2,1,0,0 : swbreak ; 槍 if id(ig+19)=4 : btsn=10 : efs 2,12,2,2,0,0 : swbreak ; 斧 if id(ig+19)=5 : btsn=11 : efs 2,13,2,2,0,0 : swbreak ; 槌 if id(ig+19)=6 : btsn=12 : efs 2,14,2,4,0,0 : swbreak ; 杖 swbreak case 3 ; 投射武器アタック if id(ig+19)=7 : btsn=13 : efs 3,16,1,1,8 ,0 : swbreak ; 弓 if id(ig+19)=8 : btsn=14 : efs 3,18,1,2,9 ,0 : swbreak ; ボウ if itn=90 : btsn=15 : efs 3,19,2,1,11,0 : swbreak ; 大砲 if id(ig+19)=9 : btsn=16 : efs 2,17,1,1,0 ,0 : swbreak ; 銃 swbreak case 10 : efs 3,20,2,3,14,1 : swbreak ; ファイヤー case 11 : efs 1,21,1,1,0 ,1,7 ,7 : swbreak ; ファイヤーウェポン case 12 : efs 1,22,2,1,0 ,1 : swbreak ; バーサーク case 13 : efs 2,23,2,1,0 ,1 : swbreak ; ファイヤーピレイム case 14 : efs 3,24,1,1,13,1 : swbreak ; フレイムアロー case 15 : efs 1,25,1,1,0 ,1 : swbreak ; バトルソング case 16 : efs 3,26,1,1,7 ,1 : swbreak ; ファイアーボール case 17 : efs 6,28,3,1,0 ,1 : swbreak ; ファイヤーウォール case 18 : efs 6,29,3,1,0 ,1 : swbreak ; エクスプロージョン case 20 : efs 3,30,1,1,18,1,2 ,0 : swbreak ; アイスニードル case 21 : efs 3,31,2,3,17,1 : swbreak ; ウォーターストリーム case 22 : efs 1,59,1,1,0 ,1 : swbreak ; ピュリファイ case 23 : efs 1,33,1,1,0 ,1,8 ,8 : swbreak ; アイスエンチャント case 24 : efs 3,34,1,1,18,1,2 ,18 : swbreak ; アイスジャベリン case 25 : efs 2,35,3,4,0 ,0 : swbreak ; アイスピラー case 26 : efs 1,36,2,1,0 ,1 : swbreak ; ウォータースクリーン case 27 : efs 6,37,3,1,0 ,1 : swbreak ; 津波 case 28 : efs 6,38,3,1,0 ,1,25,0 : swbreak ; メイルシュトローム case 29 ; ブリザード repeat 3,1 et=cnt : efs 2,39,2,1,0 ,1,8 ,8 loop swbreak case 30 : efs 3,40,1,1,8 ,1,0 ,3 : swbreak ; ウインドカッター case 31 : efs 1,41,2,1,0 ,1,7 ,7 : swbreak ; ウインドムーブ case 32 : efs 2,42,1,1,0 ,0,6 ,6 : swbreak ; サンダー case 33 : efs 1,43,1,1,0 ,0,8 ,8 : swbreak ; ウィンドエンチャント case 34 : efs 1,44,1,1,0 ,1,8 ,18 : swbreak ; サンダーウエポン case 35 : efs 6,45,2,1,0 ,0 : swbreak ; セイレーンボイス case 36 : efs 1,46,2,1,0 ,1 : swbreak ; ウィンドウォール case 37 : efs 6,47,2,1,0 ,1,8 ,30 : swbreak ; ライトニングボルト case 38 : efs 4,48,3,1,26,1,14,14 : swbreak ; ウィンドストーム case 40 : efs 1,49,2,1,0 ,1,14,14 : swbreak ; アースキュア case 41 : efs 1,50,2,1,0 ,1,12,12 : swbreak ; ハードコーティング case 42 : efs 1,58,2,1,0 ,1,12,12 : swbreak ; ネイチャーヒール case 43 : efs 2,52,1,1,0 ,1,8 ,8 : swbreak ; グラヴィティマグネット case 44 : efs 1,53,2,1,0 ,1 : swbreak ; グラビティウエポン case 45 : efs 2,54,2,1,0 ,1 : swbreak ; バインディングブランチ case 46 : efs 3,55,2,1,14,0 : swbreak ; ストーンブラスト case 47 : efs 7,56,2,1,0 ,1 : swbreak ; ゴーレムクリエイト case 48 : efs 6,57,3,1,0 ,0,0 ,13 : swbreak ; アースクエイク case 50 : efs 1,60,1,1,0 ,1,7 ,7 : swbreak ; ヒール case 51 : efs 2,61,2,1,0 ,1,8 ,8 : swbreak ; ターンアンデッド case 52 : efs 1,62,1,1,0 ,1,7 ,7 : swbreak ; フォースセンス case 53 : efs 1,63,2,1,0 ,1 : swbreak ; ホーリーライトキュア case 54 : efs 1,64,1,1,0 ,1,7 ,7 : swbreak ; ホーリーウエポン case 55 : efs 1,65,2,1,0 ,1 : swbreak ; プロテクト case 56 : efs 3,66,1,2,5 ,1,0 ,17 : swbreak ; レイアロー case 57 : efs 3,67,1,3,8 ,1 : swbreak ; サイキックフォース case 58 : efs 1,68,1,1,0 ,1,7 ,7 : swbreak ; ブレス case 59 : efs 1,69,1,1,0 ,1,17,17 : swbreak ; ホーリーライトサークル case 60 : efs 2,70,2,2,0 ,1,9 ,9 : swbreak ; レイブレイド case 61 : efs 5,71,3,1,0 ,1,50,7 : swbreak ; ホーリーライトヒール case 62 : efs 7,72,2,1,0 ,1 : swbreak ; ウィル・オ・ウィスプ case 63 : efs 8,32,2,1,0 ,1 : swbreak ; リザレクション case 70 : efs 2,73,1,1,0 ,1,9 ,9 : swbreak ; マインドブラスト case 71 : efs 2,74,2,1,0 ,1,16,16 : swbreak ; ポイズン case 72 : efs 2,75,2,1,0 ,0,20,20 : swbreak ; 邪眼 case 73 : efs 2,76,1,1,0 ,1 : swbreak ; チャーム case 74 : efs 2,77,1,1,0 ,1 : swbreak ; ウィークネス case 75 : efs 2,78,2,1,0 ,1 : swbreak ; カース case 76 : efs 2,79,1,1,0 ,1 : swbreak ; ダークネス case 77 ; フレイムカース repeat 3,1 et=cnt : efs 2,80,2,1,0 ,1,14,14 loop swbreak case 78 : efs 7,81,2,1,0 ,1 : swbreak ; デモンズゲート ; その他のエフェクト case 90 : efs 2,27,1,1,0 ,1 : swbreak ; ファイアーボールの爆発 case 91 : efs 1,90,1,1,0 ,1 : swbreak ; 麻痺 case 92 : efs 1,91,2,1,0 ,0,8 ,8 : swbreak ; スタン case 93 : efs 1,92,1,1,0 ,1 : swbreak ; 魅惑 case 94 : efs 1,93,2,1,0 ,1 : swbreak ; 火傷 case 95 : efs 1,74,2,1,0 ,1 : swbreak ; 毒 case 96 : efs 1,43,2,1,0 ,1,9 ,9 : swbreak ; 再生 ; 特殊 case 101 : efs 2,76,1,1,0 ,1 : swbreak ; チャーム case 102 : efs 7,81,2,1,0 ,1 : swbreak ; ネクロマンサー case 103 : efs 2,82,1,1,0 ,1 : swbreak ; 吸血 case 104 : efs 2,83,1,1,0 ,1,7 ,7 : swbreak ; ナイトメア case 105 : efs 6,84,1,4,0 ,1,5 ,18 : swbreak ; ファイヤーブレス case 106 : efs 6,85,1,4,0 ,1,5 ,18 : swbreak ; コールドブレス case 107 : efs 6,47,2,1,0 ,1 : swbreak ; サンダーブレス case 108 : efs 4,86,1,2,15,1 : swbreak ; 咆哮 case 109 : efs 6,87,1,1,0 ,1,20,0 : swbreak ; ホーリーブレス case 110 : efs 4,78,2,1,20,1 : swbreak ; ポイズンブレス case 111 : efs 6,37,3,1,0 ,1 : swbreak ; 津波 case 112 : efs 2,89,2,1,0 ,1 : swbreak ; 火の息 case 113 : efs 2,27,1,1,0 ,1 : swbreak ; ファイアーボールの爆発 case 114 : efs 3,26,1,1,7 ,1 : swbreak ; ファイアーボール case 115 : efs 6,29,3,1,0 ,1 : swbreak ; ファイアーストーム case 116 : efs 6,39,2,1,0 ,1 : swbreak ; コールドストーム case 117 : efs 2,80,2,1,0 ,1 : swbreak ; ダークスフィア case 118 : efs 3,48,3,1,20,1 : swbreak ; ウィンドストーム swend return |
前回に比べたら随分スッキリしたと思う。
bts1~いくつかを、全部 btsで処理するようにまとめ、switch文で処理し、エフェクトNo.とグラのNo.を別にする事によって一つのグラを使いまわせるようにした。
大きさの修正データを btsに移した。
efsの switch文を整理して汎用性を上げた。
そんな所かな。
ところでエフェクトのデータはキャラやアイテムより大きいと書いたが、数字を見ると意外とそうでもなかったので参考までに報告してみる。
キャラデータ(画像は縮小)
7.43MB
アイテムデータ(画像は縮小)
10.1MB
エフェクトデータ(こんな感じで 90個くらい)
18MB
そんなに差はなかったけど、キャラとアイテムは bmpだからかな?
次は戦闘プログラムを整理する予定。