-
Contributor
[v7.6] [ENGLISH] [glq] AncientParthanCount
Supported TurboHUD version: 9.0
AncientParthanCount.cs - Pastebin.com
Place in plugins\glq\AncientParthanCount.cs
When you equiped AncientParthan, it will help you calculate damage reduction
Thanks to JACK for some code snippets
Change log
17.8.29
1.Change display mode
17.8.1
1.Fixd when you don't have a power in kanai armor slot occur exception
2.Automatically read the effect value, credits is for JACK
change the position
Code:
Hud.GetPlugin<AncientParthanCount>().XWidth = 0.3f;
Hud.GetPlugin<AncientParthanCount>().YHeight = 0.3f;
Change font size and color etc.
Code:
Hud.GetPlugin<AncientParthanCount>().TextFont = Hud.Render.CreateFont("tahoma", 9, 255, 170, 90, 90, false, false, true);
Last edited by SeaDragon; 02-13-2019 at 10:48 AM.
-
Post Thanks / Like - 3 Thanks
-
Contributor
hi,
nice work.
you can optimize your code a bit:
change
PHP Code:
double dr = 1;
for (int a = 0; a < Count; a = a + 1)
{
double b = 1 - percent * 0.01d;
dr = b * dr;
}
to
PHP Code:
double dr = 1;
double b = 1 - percent * 0.01d;
for (int a = 0; a < Count; a++)
dr = b * dr;
because you have always the same value for "b"
or use Math.Pow
PHP Code:
double b = 1 - percent * 0.01d;
double dr = Math.Pow(b, Count);
for an increment of 1 you can use "a++" instead of "a = a+1"
greetz gjuz
-
Contributor
How should the second methods be used?
-
Member
The sum is not correct
特效要自己手動更改嗎?萬一有變動的話
Last edited by odaru7788; 05-07-2017 at 12:09 AM.
-
Contributor
Originally Posted by
odaru7788
The sum is not correct
特效要自己手動更改嗎?萬一有變動的話
如果不是萃取的话需要你自己修改特效
change the AncientParthan effect of percent value, If using cube, always be 12
重命名plugins\User\PluginEnablerOrDisablerPlugin.txt 为PluginEnablerOrDisablerPlugin.cs
添加以下代码到定制区(12代表特效百分比)
Code:
Hud.GetPlugin<AncientParthanCount>().percent = 12;
Last edited by SeaDragon; 05-07-2017 at 03:06 AM.
-
Member
如同你貼的那張圖
1隻昏迷是12%
但3隻卻不是36%
這是甚麼原因?
-
Contributor
Originally Posted by
odaru7788
如同你貼的那張圖
1隻昏迷是12%
但3隻卻不是36%
這是甚麼原因?
计算公式并不是加法,而是乘法,不然岂不是10个怪就100%减伤无敌了
1-(1-12%)*(1-12%)*(1-12%)=31.85%
Last edited by SeaDragon; 05-07-2017 at 04:11 AM.
-
Post Thanks / Like - 1 Thanks
odaru7788 (1 members gave Thanks to SeaDragon for this useful post)
-
Contributor
Originally Posted by
SeaDragon
How should the second methods be used?
you did what i meant. the point was not to calculate "b" every loop.
PHP Code:
for (int a = 0; a < Count; a++) dr = b * dr;
does the same as
PHP Code:
dr = Math.Pow(b, Count);
(b to the power of Count ==> b^Count)
greetz gjuz
-
Contributor
@odaru7788,
i can only guess what you have written, so
damage reduction is always multiplicative, thus you cannot get 100% dmg reduce.
Code:
1 - (1-R_1) *(1-R_2) * *** * (1-R_n)
where R_i is the amount of damage reduction.
it is not additive. thus three stacks of APD isn't
3*0.12 = 0.36 reduction
it is:
1 - (1 - 0.12)^3 = 0.318528
greetz gjuz
-
Post Thanks / Like - 1 Thanks
odaru7788 (1 members gave Thanks to gjuz for this useful post)
-
Contributor
Well, because I'm missing this, so there's an exception
Updated
Last edited by SeaDragon; 05-09-2017 at 01:07 AM.
-
Contributor
17.8.29 update
Change display mode
-
Member
hello i did
AncientParthanCount.cs - Pastebin.com
Place in plugins\glq\AncientParthanCount.cs
Kill turboHud from task manager and restart TurboHud.
and I dont see anychange? .. i think i miss something ... first time trying to add plugins.
-
Contributor
Originally Posted by
sacrefizz
hello i did
AncientParthanCount.cs - Pastebin.com
Place in plugins\glq\AncientParthanCount.cs
Kill turboHud from task manager and restart TurboHud.
and I dont see anychange? .. i think i miss something ... first time trying to add plugins.
If you are sure that your steps are right, it should be works!
-
Contributor
Originally Posted by
sacrefizz
hello i did
AncientParthanCount.cs - Pastebin.com
Place in plugins\glq\AncientParthanCount.cs
Kill turboHud from task manager and restart TurboHud.
and I dont see anychange? .. i think i miss something ... first time trying to add plugins.
you can also stop THud with "Ctrl + End"
greetz gjuz
-
Post Thanks / Like - 1 Thanks
sacrefizz (1 members gave Thanks to gjuz for this useful post)
-
Member
okay it work .. i just dont saw it .. show up and hide quickly.
now trying .. to change the position ... i want it near my health Globe.
change the position
Code:
Hud.GetPlugin<AncientParthanCount>().XWidth = 0.3f;
Hud.GetPlugin<AncientParthanCount>().YHeight = 0.3f;
I put this code in PluginEnablerOrDisablerPlugin.cs?
i found this :
public override void Load(IController hud)
{
base.Load(hud);
TextFont = Hud.Render.CreateFont("tahoma", 9, 255, 170, 90, 90, false, false, true);
XWidth = 0.3f;
YHeight = 0.3f;
percent = 0;
AncientParthanDecorator = new TopLabelDecorator(Hud)
{
i think i have to modify your code. i tryed in PluginEnablerOrDisablerPlugin.cs and got exception : PluginEnablerOrDisablerPlugin.cs(42,17) : error CS0246: The type or namespace name 'AncientParthanCount' could not be found (are you missing a using directive or an assembly reference?)
Last edited by sacrefizz; 12-07-2017 at 06:30 PM.