作者hlead (希多)
看板mud_sanc
標題Re: [閒聊] 抗性相關設定
時間Wed Jul 27 12:40:01 2011
※ 引述《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)
→ laechan :shut_d.c 我最近要動, 你已經改完了? 07/27 13:26
→ hlead :嗯..改完了.. 07/27 13:44
→ hlead :剩複雜計算那邊 不知道要不要加而已... 07/27 13:45
→ laechan :你可以自己判斷 + 實裝後看情況斟酌 07/27 13:57
→ hlead :我是預計過幾天後再看看 07/27 13:59
→ hlead :話說玩家身上的anti_percent有些怪怪的.. 07/27 14:00
→ hlead :默默的又是負數.. 07/27 14:00
→ laechan :要看某個 simul_efun 有沒有被用到就用 grep 去找 07/27 14:05
→ laechan :負數就是我之前提過的,因為它沒有 new 函數去 new 它 07/27 14:05
→ hlead :嗯 我找是沒有啦..只是多問看看一次而已..avert 07/27 14:19
→ hlead :可是他也是在effect當中..不是理論上也會自動new? 07/27 14:20