blob: fedf3bab5f82218284d66a80d60f62950056fd52 (
plain)
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
|
package jp.plusplus.fbs.api;
import jp.plusplus.fbs.api.IMagicEnchant;
import jp.plusplus.fbs.api.MagicBase;
import net.minecraft.entity.EntityLivingBase;
/**
* Created by pluslus_F on 2015/06/22.
*/
public abstract class MagicEnchantBase extends MagicBase implements IMagicEnchant {
protected int trial, max;
public MagicEnchantBase(int t, int m){
trial=t;
max=m;
}
@Override
public void success() {
enchant(player, true);
}
@Override
public void failure() {
sanity(trial, max);
enchant(player, false);
}
public int getAmplifier(int rate){
int t=getLvDiff();
if(t<=0) return 1;
int a=1+t/rate;
return a>5?5:a;
}
public int getDuration(int base, float rate){
int t=getLvDiff();
if(t<=0) return 20*base;
return (int)(20*(base+t/rate));
}
@Override
public float damageScale(EntityLivingBase entity){
return 0.f;
}
@Override
public float damageValue(EntityLivingBase entity){
return 0.f;
}
@Override
public ParticleColor setParticleColor(){
return new ParticleColor();
}
}
|