Re: [閒聊] 抗性相關設定

看板mud_sanc (Sanctuary - 聖殿)作者 (希多)時間14年前 (2011/07/27 12:40), 編輯推噓0(0011)
留言11則, 2人參與, 最新討論串3/3 (看更多)
※ 引述《laechan (小太保)》之銘言: : 底下是範例函數 : // 各抗性共用同一份 table : mixed ant_table=({ ({...}), : ({...}), : }); // 二維陣列 改為下面這樣好了。 // kind = 屬性 , variety = 種類 , c = 威力級數。 if(c>5) c=5; // 威力級數 max = 5 。 // 讀取身上總抗性 anti_tmp=(int)tar->query("anti_percent/all")+ (int)tar->query("anti_percent/"+kind)+ (int)tar->query("anti_percent/"+variety); // 抗性與傷害的公式計算 if(anti_tmp) { anti_tmp * (10-c) / 10; // 威力級數會影響抗性效果 if(anti_tmp>99) anti_tmp=99; // 鎖住最大抗性 damage=(1+damage/100)*(100-anti_tmp); } anti_tmp * (10-c) / 10; 這個其實可以改查表。 要複雜計算的話,也可以判別 if (c < (anti_tmp + 1)/20) anti_tmp += 10; 舉例來說,lv 3 威力的火球... 只要抗火 60 就可以達到 抗火 70 的效果。 這是一種差距極大時所產生的額外附加效果。 這樣感覺會很複雜計算orz.. ------------------------- 如果照以上寫法的話(目前已更新上去。) mob的抗性部分就要改設為: anti_tmp=(int)tar->query("anti_percent/all")+ (int)tar->query("anti_percent/"+kind)+ (int)tar->query("anti_percent/"+variety); 裝備部分沒差,因為有同化機制。 ------------------------ /adm/simul_efun/new_and_count.c下有: int get_anti_percent(int damage,int percent) { if(percent>MAX_ANTI_PERCENT) return damage; if(percent<-MAX_ANTI_PERCENT) return damage; return (damage/100)*percent; } 目前有效果?...看起來好像是沒用的.. -- Norr@Sanc 風,吹散了一切煩惱,只留下平靜的思考。 雨,淋落了一切紛亂,只剩下無比的快樂。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.117.46.189 ※ 編輯: hlead 來自: 122.117.46.189 (07/27 13:23)

07/27 13:26, , 1F
shut_d.c 我最近要動, 你已經改完了?
07/27 13:26, 1F

07/27 13:44, , 2F
嗯..改完了..
07/27 13:44, 2F

07/27 13:45, , 3F
剩複雜計算那邊 不知道要不要加而已...
07/27 13:45, 3F

07/27 13:57, , 4F
你可以自己判斷 + 實裝後看情況斟酌
07/27 13:57, 4F

07/27 13:59, , 5F
我是預計過幾天後再看看
07/27 13:59, 5F

07/27 14:00, , 6F
話說玩家身上的anti_percent有些怪怪的..
07/27 14:00, 6F

07/27 14:00, , 7F
默默的又是負數..
07/27 14:00, 7F

07/27 14:05, , 8F
要看某個 simul_efun 有沒有被用到就用 grep 去找
07/27 14:05, 8F

07/27 14:05, , 9F
負數就是我之前提過的,因為它沒有 new 函數去 new 它
07/27 14:05, 9F

07/27 14:19, , 10F
嗯 我找是沒有啦..只是多問看看一次而已..avert
07/27 14:19, 10F

07/27 14:20, , 11F
可是他也是在effect當中..不是理論上也會自動new?
07/27 14:20, 11F
文章代碼(AID): #1EBvQb8- (mud_sanc)
討論串 (同標題文章)
文章代碼(AID): #1EBvQb8- (mud_sanc)