Commit 10d4af877022cdbc72c09af9c3f7d0c12b1012c2

Authored by dg
1 parent a990f68b

test


git-svn-id: http://svn.net-core.org/repos/t-engine4@4668 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -68,8 +68,8 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr)
68 68 print("[PROJECTOR] after necrotic increase dam", dam)
69 69 end
70 70
71   - if target.isTalentActive and target:isTalentActive(target.T_GESTURE_OF_GUARDING) then
72   - local t = target:getTalentFromId(target.T_GESTURE_OF_GUARDING)
  71 + if src.isTalentActive and src:isTalentActive(target.T_GESTURE_OF_GUARDING) then
  72 + local t = src:getTalentFromId(target.T_GESTURE_OF_GUARDING)
73 73 dam = t.on_damageInflicted(target, t, type, dam, src)
74 74 end
75 75
... ...
... ... @@ -40,13 +40,13 @@ newTalent{
40 40 game.logPlayer(self, "You do not have a free hand to use Gesture of Pain.")
41 41 return false
42 42 end
43   -
  43 +
44 44 return true
45 45 end,
46 46 attack = function(self, t, target)
47   - local freeHands = self:getFreeHands()
  47 + local freeHands = self:getFreeHands()
48 48 local hit = false
49   -
  49 +
50 50 local mindpower = self:combatMindpower()
51 51 local baseDamage = t.getBaseDamage(self, t)
52 52 if self:checkHit(mindpower, target:combatMentalResist()) then
... ... @@ -59,7 +59,7 @@ newTalent{
59 59 game.logSeen(self, "%s resists the Gesture of Pain.", target.name:capitalize())
60 60 game:playSoundNear(self, "actions/melee_miss")
61 61 end
62   -
  62 +
63 63 if not target.dead and freeHands > 1 and self.hate >= 0.1 and rng.chance(t.getSecondAttackChance(self, t)) then
64 64 if self:checkHit(mindpower, target:combatMentalResist()) then
65 65 local damage = baseDamage * rng.float(0.5, 1)
... ... @@ -72,11 +72,11 @@ newTalent{
72 72 game:playSoundNear(self, "actions/melee_miss")
73 73 end
74 74 end
75   -
  75 +
76 76 if hit then
77 77 game.level.map:particleEmitter(target.x, target.y, 1, "melee_attack", {color=colors.VIOLET})
78 78 end
79   -
  79 +
80 80 return self:combatSpeed(), hit
81 81 end,
82 82 activate = function(self, t)
... ... @@ -102,7 +102,7 @@ newTalent{
102 102 getMindpowerChange = function(self, t, freeHands)
103 103 freeHands = freeHands or self:getFreeHands()
104 104 if freeHands == 0 then return 0 end
105   -
  105 +
106 106 local change = math.pow(self:getTalentLevel(t), 0.7) * 4
107 107 if freeHands > 1 then change = change * 1.4 end
108 108 return math.floor(change)
... ... @@ -123,7 +123,7 @@ newTalent{
123 123 getMindCritChange = function(self, t, freeHands)
124 124 freeHands = freeHands or self:getFreeHands()
125 125 if freeHands == 0 then return 0 end
126   -
  126 +
127 127 local change = math.pow(self:getTalentLevel(t), 0.5) * 2
128 128 if freeHands > 1 then change = change * 1.4 end
129 129 return change
... ... @@ -145,16 +145,18 @@ newTalent{
145 145 getDamageResistChange = function(self, t, distance, freeHands)
146 146 freeHands = freeHands or self:getFreeHands()
147 147 if freeHands == 0 then return 0 end
148   -
  148 +
149 149 local change = math.pow(self:getTalentLevel(t), 0.5) * 1.15
150 150 if freeHands > 1 then change = change * 1.4 end
  151 + print("===dec by", change,change * math.min(7, distance))
151 152 return change * math.min(7, distance)
152 153 end,
153 154 getIncDamageChange = function(self, t, distance)
154 155 local change = -(2 + math.pow(self:getTalentLevel(t), 0.5) * 0.8)
  156 + print("===inc by", change,change * math.min(7, distance))
155 157 return change * math.min(7, distance)
156 158 end,
157   - on_damageRecieved = function(self, t, type, dam, src)
  159 + on_damageReceived = function(self, t, type, dam, src)
158 160 if src and src.x and src.y and (self.x ~= src.x or self.y ~= src.y) and self:hasLOS(src.x, src.y) then
159 161 local distance = core.fov.distance(src.x, src.y, self.x, self.y)
160 162 dam = dam * (100 - t.getDamageResistChange(self, t, distance) / 100)
... ... @@ -168,6 +170,12 @@ newTalent{
168 170 end
169 171 return dam
170 172 end,
  173 + activate = function(self, t)
  174 + return {}
  175 + end,
  176 + deactivate = function(self, t, p)
  177 + return true
  178 + end,
171 179 info = function(self, t)
172 180 local damageResistChange1 = t.getDamageResistChange(self, t, 1, 1)
173 181 local damageResistChangeMax1 = t.getDamageResistChange(self, t, 1000, 1)
... ...
... ... @@ -26,6 +26,11 @@ static char *__BIND_PHYSFS_toDependent(dvoid *opaque, const char *name, const ch
26 26 else
27 27 {
28 28 char *f = __PHYSFS_platformCvtToDependent((char *)opaque, name, NULL);
  29 +
  30 + // FIXME: I'm a very very dirty hack; __PHYSFS_platformCvtToDependent is not really meant to return a platform independant path, so why turn it into one (for poor windows users)
  31 + char *c = f;
  32 + while (*c) { if (*c == '\\') *c = '/'; c++; }
  33 +
29 34 return f;
30 35 }
31 36 }
... ...