Skip to content

Commit 341125b

Browse files
committed
improve: remove empty monsters callbacks and register setReward in monster lib
Removed empty callbacks and move the "setRewardBoss" function to the "monster type" lib. This centralizes the call in one place, facilitating maintenance and reducing overhead.
1 parent 1d9d886 commit 341125b

File tree

219 files changed

+195
-2882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+195
-2882
lines changed

data-canary/monster/bosses/apocalypse.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,4 @@ monster.immunities = {
143143
{ type = "bleed", condition = false },
144144
}
145145

146-
mType.onThink = function(monster, interval) end
147-
148-
mType.onAppear = function(monster, creature)
149-
if monster:getType():isRewardBoss() then
150-
monster:setReward(true)
151-
end
152-
end
153-
154-
mType.onDisappear = function(monster, creature) end
155-
156-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
157-
158-
mType.onSay = function(monster, creature, type, message) end
159-
160146
mType:register(monster)

data-canary/monster/bosses/apprentice_sheng.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,4 @@ monster.immunities = {
117117
{ type = "bleed", condition = false },
118118
}
119119

120-
mType.onThink = function(monster, interval) end
121-
122-
mType.onAppear = function(monster, creature)
123-
if monster:getType():isRewardBoss() then
124-
monster:setReward(true)
125-
end
126-
end
127-
128-
mType.onDisappear = function(monster, creature) end
129-
130-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
131-
132-
mType.onSay = function(monster, creature, type, message) end
133-
134120
mType:register(monster)

data-canary/monster/bosses/bazir.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,4 @@ monster.immunities = {
179179
{ type = "bleed", condition = false },
180180
}
181181

182-
mType.onThink = function(monster, interval) end
183-
184-
mType.onAppear = function(monster, creature)
185-
if monster:getType():isRewardBoss() then
186-
monster:setReward(true)
187-
end
188-
end
189-
190-
mType.onDisappear = function(monster, creature) end
191-
192-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
193-
194-
mType.onSay = function(monster, creature, type, message) end
195-
196182
mType:register(monster)

data-canary/monster/bosses/black_knight.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,4 @@ monster.immunities = {
126126
{ type = "bleed", condition = false },
127127
}
128128

129-
mType.onThink = function(monster, interval) end
130-
131-
mType.onAppear = function(monster, creature)
132-
if monster:getType():isRewardBoss() then
133-
monster:setReward(true)
134-
end
135-
end
136-
137-
mType.onDisappear = function(monster, creature) end
138-
139-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
140-
141-
mType.onSay = function(monster, creature, type, message) end
142-
143129
mType:register(monster)

data-canary/monster/bosses/bullwark.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,4 @@ monster.immunities = {
124124
{ type = "bleed", condition = false },
125125
}
126126

127-
mType.onThink = function(monster, interval) end
128-
129-
mType.onAppear = function(monster, creature)
130-
if monster:getType():isRewardBoss() then
131-
monster:setReward(true)
132-
end
133-
end
134-
135-
mType.onDisappear = function(monster, creature) end
136-
137-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
138-
139-
mType.onSay = function(monster, creature, type, message) end
140-
141127
mType:register(monster)

data-canary/monster/bosses/custodian.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,4 @@ monster.immunities = {
102102
{ type = "bleed", condition = false },
103103
}
104104

105-
mType.onThink = function(monster, interval) end
106-
107-
mType.onAppear = function(monster, creature)
108-
if monster:getType():isRewardBoss() then
109-
monster:setReward(true)
110-
end
111-
end
112-
113-
mType.onDisappear = function(monster, creature) end
114-
115-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
116-
117-
mType.onSay = function(monster, creature, type, message) end
118-
119105
mType:register(monster)

data-canary/monster/bosses/dharalion.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,4 @@ monster.immunities = {
132132
{ type = "bleed", condition = false },
133133
}
134134

135-
mType.onThink = function(monster, interval) end
136-
137-
mType.onAppear = function(monster, creature)
138-
if monster:getType():isRewardBoss() then
139-
monster:setReward(true)
140-
end
141-
end
142-
143-
mType.onDisappear = function(monster, creature) end
144-
145-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
146-
147-
mType.onSay = function(monster, creature, type, message) end
148-
149135
mType:register(monster)

data-canary/monster/bosses/shadowpelt.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,4 @@ monster.immunities = {
135135
{ type = "bleed", condition = false },
136136
}
137137

138-
mType.onThink = function(monster, interval) end
139-
140-
mType.onAppear = function(monster, creature)
141-
if monster:getType():isRewardBoss() then
142-
monster:setReward(true)
143-
end
144-
end
145-
146-
mType.onDisappear = function(monster, creature) end
147-
148-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
149-
150-
mType.onSay = function(monster, creature, type, message) end
151-
152138
mType:register(monster)

data-otservbr-global/monster/bosses/alchemist_container.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,4 @@ monster.immunities = {
7979
{ type = "bleed", condition = false },
8080
}
8181

82-
mType.onThink = function(monster, interval) end
83-
84-
mType.onAppear = function(monster, creature)
85-
if monster:getType():isRewardBoss() then
86-
monster:setReward(true)
87-
end
88-
end
89-
90-
mType.onDisappear = function(monster, creature) end
91-
92-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
93-
94-
mType.onSay = function(monster, creature, type, message) end
95-
9682
mType:register(monster)

data-otservbr-global/monster/bosses/antenna.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,4 @@ monster.immunities = {
7979
{ type = "bleed", condition = false },
8080
}
8181

82-
mType.onThink = function(monster, interval) end
83-
84-
mType.onAppear = function(monster, creature)
85-
if monster:getType():isRewardBoss() then
86-
monster:setReward(true)
87-
end
88-
end
89-
90-
mType.onDisappear = function(monster, creature) end
91-
92-
mType.onMove = function(monster, creature, fromPosition, toPosition) end
93-
94-
mType.onSay = function(monster, creature, type, message) end
95-
9682
mType:register(monster)

0 commit comments

Comments
 (0)