Otclient  14/8/2020
tile.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2020 OTClient <https://github.com/edubart/otclient>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 
23 #include "tile.h"
24 #include "item.h"
25 #include "thingtypemanager.h"
26 #include "map.h"
27 #include "game.h"
28 #include "localplayer.h"
29 #include "effect.h"
30 #include "protocolgame.h"
31 #include "lightview.h"
33 
34 Tile::Tile(const Position& position) :
35  m_position(position),
36  m_drawElevation(0),
37  m_minimapColor(0),
38  m_flags(0)
39 {
40 }
41 
42 void Tile::draw(const Point& dest, float scaleFactor, int drawFlags, LightView *lightView)
43 {
44  bool animate = drawFlags & Otc::DrawAnimations;
45 
46  /* Flags to be checked for. */
47  static const tileflags_t flags[] = {
55  };
56 
57  // first bottom items
59  m_drawElevation = 0;
60  for(const ThingPtr& thing : m_things) {
61  if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom())
62  break;
63 
64  bool restore = false;
65  if(g_map.showZones() && thing->isGround()) {
66  for(auto flag: flags) {
67  if(hasFlag(flag) && g_map.showZone(flag)) {
70  restore = true;
71  break;
72  }
73  }
74  }
75  if(m_selected)
77 
78  if((thing->isGround() && drawFlags & Otc::DrawGround) ||
79  (thing->isGroundBorder() && drawFlags & Otc::DrawGroundBorders) ||
80  (thing->isOnBottom() && drawFlags & Otc::DrawOnBottom)) {
81  thing->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate, lightView);
82 
83  if(restore) {
86  }
87  }
88  if(m_selected)
90 
91  m_drawElevation += thing->getElevation();
92  if(m_drawElevation > Otc::MAX_ELEVATION)
93  m_drawElevation = Otc::MAX_ELEVATION;
94  }
95  }
96 
97  if(drawFlags & Otc::DrawItems) {
98  // now common items in reverse order
99  for(auto it = m_things.rbegin(); it != m_things.rend(); ++it) {
100  const ThingPtr& thing = *it;
101  if(thing->isOnTop() || thing->isOnBottom() || thing->isGroundBorder() || thing->isGround() || thing->isCreature())
102  break;
103  thing->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate, lightView);
104  m_drawElevation += thing->getElevation();
105  if(m_drawElevation > Otc::MAX_ELEVATION)
106  m_drawElevation = Otc::MAX_ELEVATION;
107  }
108  }
109 
110  // creatures
111  if(drawFlags & Otc::DrawCreatures) {
112  if(animate) {
113  for(const CreaturePtr& creature : m_walkingCreatures) {
114  creature->draw(Point(dest.x + ((creature->getPosition().x - m_position.x)*Otc::TILE_PIXELS - m_drawElevation)*scaleFactor,
115  dest.y + ((creature->getPosition().y - m_position.y)*Otc::TILE_PIXELS - m_drawElevation)*scaleFactor), scaleFactor, animate, lightView);
116  }
117  }
118 
119  for(auto it = m_things.rbegin(); it != m_things.rend(); ++it) {
120  const ThingPtr& thing = *it;
121  if(!thing->isCreature())
122  continue;
123  CreaturePtr creature = thing->static_self_cast<Creature>();
124  if(creature && (!creature->isWalking() || !animate))
125  creature->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate, lightView);
126  }
127  }
128 
129  // effects
130  if(drawFlags & Otc::DrawEffects)
131  for(const EffectPtr& effect : m_effects)
132  effect->drawEffect(dest - m_drawElevation*scaleFactor, scaleFactor, animate, m_position.x - g_map.getCentralPosition().x, m_position.y - g_map.getCentralPosition().y, lightView);
133 
134  // top items
135  if(drawFlags & Otc::DrawOnTop)
136  for(const ThingPtr& thing : m_things)
137  if(thing->isOnTop())
138  thing->draw(dest, scaleFactor, animate, lightView);
139 
140  // draw translucent light (for tiles beneath holes)
141  if(hasTranslucentLight() && lightView) {
142  Light light;
143  light.intensity = 1;
144  lightView->addLightSource(dest + Point(16,16) * scaleFactor, scaleFactor, light);
145  }
146 }
147 
149 {
150  while(!m_things.empty())
151  removeThing(m_things.front());
152 }
153 
155 {
156  m_walkingCreatures.push_back(creature);
157 }
158 
160 {
161  auto it = std::find(m_walkingCreatures.begin(), m_walkingCreatures.end(), creature);
162  if(it != m_walkingCreatures.end())
163  m_walkingCreatures.erase(it);
164 }
165 
166 void Tile::addThing(const ThingPtr& thing, int stackPos)
167 {
168  if(!thing)
169  return;
170 
171  if(thing->isEffect()) {
172  if(thing->isTopEffect())
173  m_effects.insert(m_effects.begin(), thing->static_self_cast<Effect>());
174  else
175  m_effects.push_back(thing->static_self_cast<Effect>());
176  } else {
177  // priority 854
178  // 0 - ground, --> -->
179  // 1 - ground borders --> -->
180  // 2 - bottom (walls), --> -->
181  // 3 - on top (doors) --> -->
182  // 4 - creatures, from top to bottom <-- -->
183  // 5 - items, from top to bottom <-- <--
184  if(stackPos < 0 || stackPos == 255) {
185  int priority = thing->getStackPriority();
186 
187  // -1 or 255 => auto detect position
188  // -2 => append
189 
190  bool append;
191  if(stackPos == -2)
192  append = true;
193  else {
194  append = (priority <= 3);
195 
196  // newer protocols does not store creatures in reverse order
197  if(g_game.getClientVersion() >= 854 && priority == 4)
198  append = !append;
199  }
200 
201 
202  for(stackPos = 0; stackPos < (int)m_things.size(); ++stackPos) {
203  int otherPriority = m_things[stackPos]->getStackPriority();
204  if((append && otherPriority > priority) || (!append && otherPriority >= priority))
205  break;
206  }
207  } else if(stackPos > (int)m_things.size())
208  stackPos = m_things.size();
209 
210  m_things.insert(m_things.begin() + stackPos, thing);
211 
212  if(m_things.size() > MAX_THINGS)
213  removeThing(m_things[MAX_THINGS]);
214 
215  /*
216  // check stack priorities
217  // this code exists to find stackpos bugs faster
218  int lastPriority = 0;
219  for(const ThingPtr& thing : m_things) {
220  int priority = thing->getStackPriority();
221  assert(lastPriority <= priority);
222  lastPriority = priority;
223  }
224  */
225  }
226 
227  thing->setPosition(m_position);
228  thing->onAppear();
229 
230  if(thing->isTranslucent())
231  checkTranslucentLight();
232 }
233 
235 {
236  if(!thing)
237  return false;
238 
239  bool removed = false;
240 
241  if(thing->isEffect()) {
242  EffectPtr effect = thing->static_self_cast<Effect>();
243  auto it = std::find(m_effects.begin(), m_effects.end(), effect);
244  if(it != m_effects.end()) {
245  m_effects.erase(it);
246  removed = true;
247  }
248  } else {
249  auto it = std::find(m_things.begin(), m_things.end(), thing);
250  if(it != m_things.end()) {
251  m_things.erase(it);
252  removed = true;
253  }
254  }
255 
256  thing->onDisappear();
257 
258  if(thing->isTranslucent())
259  checkTranslucentLight();
260 
261  return removed;
262 }
263 
265 {
266  if(stackPos >= 0 && stackPos < (int)m_things.size())
267  return m_things[stackPos];
268  return nullptr;
269 }
270 
272 {
273  for(const EffectPtr& effect : m_effects)
274  if(effect->getId() == id)
275  return effect;
276  return nullptr;
277 }
278 
279 bool Tile::hasThing(const ThingPtr& thing)
280 {
281  return std::find(m_things.begin(), m_things.end(), thing) != m_things.end();
282 }
283 
285 {
286  for(uint stackpos = 0; stackpos < m_things.size(); ++stackpos)
287  if(thing == m_things[stackpos])
288  return stackpos;
289  return -1;
290 }
291 
293 {
294  if(isEmpty())
295  return nullptr;
296  for(const ThingPtr& thing : m_things)
297  if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop() && !thing->isCreature())
298  return thing;
299  return m_things[m_things.size() - 1];
300 }
301 
302 std::vector<ItemPtr> Tile::getItems()
303 {
304  std::vector<ItemPtr> items;
305  for(const ThingPtr& thing : m_things) {
306  if(!thing->isItem())
307  continue;
308  ItemPtr item = thing->static_self_cast<Item>();
309  items.push_back(item);
310  }
311  return items;
312 }
313 
314 std::vector<CreaturePtr> Tile::getCreatures()
315 {
316  std::vector<CreaturePtr> creatures;
317  for(const ThingPtr& thing : m_things) {
318  if(thing->isCreature())
319  creatures.push_back(thing->static_self_cast<Creature>());
320  }
321  return creatures;
322 }
323 
325 {
326  ThingPtr firstObject = getThing(0);
327  if(!firstObject)
328  return nullptr;
329  if(firstObject->isGround() && firstObject->isItem())
330  return firstObject->static_self_cast<Item>();
331  return nullptr;
332 }
333 
335 {
336  int groundSpeed = 100;
337  if(ItemPtr ground = getGround())
338  groundSpeed = ground->getGroundSpeed();
339  return groundSpeed;
340 }
341 
343 {
344  uint8 color = 255; // alpha
345  if(m_minimapColor != 0)
346  return m_minimapColor;
347 
348  for(const ThingPtr& thing : m_things) {
349  if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop())
350  break;
351  uint8 c = thing->getMinimapColor();
352  if(c != 0)
353  color = c;
354  }
355  return color;
356 }
357 
359 {
360  if(isEmpty())
361  return nullptr;
362 
363  for(auto thing: m_things) {
364  if(!thing->isIgnoreLook() && (!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop()))
365  return thing;
366  }
367 
368  return m_things[0];
369 }
370 
372 {
373  if(isEmpty())
374  return nullptr;
375 
376  for(auto thing: m_things) {
377  if (thing->isForceUse() || (!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop() && !thing->isCreature() && !thing->isSplash()))
378  return thing;
379  }
380 
381  for(auto thing: m_things) {
382  if (!thing->isGround() && !thing->isGroundBorder() && !thing->isCreature() && !thing->isSplash())
383  return thing;
384  }
385 
386  return m_things[0];
387 }
388 
390 {
391  CreaturePtr creature;
392  for(auto thing: m_things) {
393  if(thing->isLocalPlayer()) // return local player if there is no other creature
394  creature = thing->static_self_cast<Creature>();
395  else if(thing->isCreature() && !thing->isLocalPlayer())
396  return thing->static_self_cast<Creature>();
397  }
398  if(!creature && !m_walkingCreatures.empty())
399  creature = m_walkingCreatures.back();
400 
401  // check for walking creatures in tiles around
402  if(!creature) {
403  for(int xi=-1;xi<=1;++xi) {
404  for(int yi=-1;yi<=1;++yi) {
405  Position pos = m_position.translated(xi, yi);
406  if(pos == m_position)
407  continue;
408 
409  const TilePtr& tile = g_map.getTile(pos);
410  if(tile) {
411  for(const CreaturePtr& c : tile->getCreatures()) {
412  if(c->isWalking() && c->getLastStepFromPosition() == m_position && c->getStepProgress() < 0.75f) {
413  creature = c;
414  }
415  }
416  }
417  }
418  }
419  }
420  return creature;
421 }
422 
424 {
425  if(isEmpty())
426  return nullptr;
427 
428  for(uint i = 0; i < m_things.size(); ++i) {
429  ThingPtr thing = m_things[i];
430  if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop() && !thing->isCreature()) {
431  if(i > 0 && thing->isNotMoveable())
432  return m_things[i-1];
433  return thing;
434  }
435  }
436 
437  for(const ThingPtr& thing : m_things) {
438  if(thing->isCreature())
439  return thing;
440  }
441 
442  return m_things[0];
443 }
444 
446 {
447  if(isEmpty())
448  return nullptr;
449 
450  if(CreaturePtr topCreature = getTopCreature())
451  return topCreature;
452 
453  for(auto thing: m_things) {
454  if(thing->isForceUse())
455  return thing;
456  }
457 
458  for(uint i = 0; i < m_things.size(); ++i) {
459  ThingPtr thing = m_things[i];
460  if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop()) {
461  if(i > 0 && thing->isSplash())
462  return m_things[i-1];
463  return thing;
464  }
465  }
466 
467  for(auto thing: m_things) {
468  if(!thing->isGround() && !thing->isOnTop())
469  return thing;
470  }
471 
472  return m_things[0];
473 }
474 
475 bool Tile::isWalkable(bool ignoreCreatures)
476 {
477  if(!getGround())
478  return false;
479 
480  for(const ThingPtr& thing : m_things) {
481  if(thing->isNotWalkable())
482  return false;
483 
484  if(!ignoreCreatures) {
485  if(thing->isCreature()) {
486  CreaturePtr creature = thing->static_self_cast<Creature>();
487  if(!creature->isPassable() && creature->canBeSeen())
488  return false;
489  }
490  }
491  }
492  return true;
493 }
494 
496 {
497  for(const ThingPtr& thing : m_things)
498  if(thing->isNotPathable())
499  return false;
500  return true;
501 }
502 
504 {
505  ItemPtr ground = getGround();
506  if(ground && ground->isFullGround())
507  return true;
508  return false;
509 }
510 
512 {
513  ThingPtr firstObject = getThing(0);
514  return firstObject && firstObject->isFullGround();
515 }
516 
518 {
519  if(!m_walkingCreatures.empty())
520  return false;
521  for(const ThingPtr& thing : m_things)
522  if(thing->getHeight() != 1 || thing->getWidth() != 1)
523  return false;
524  return true;
525 }
526 
528 {
529  for(const ThingPtr& thing : m_things)
530  if(thing->blockProjectile())
531  return false;
532  return true;
533 }
534 
536 {
537  bool hasGround = false;
538  bool hasOnBottom = false;
539  bool hasIgnoreLook = false;
540  for(const ThingPtr& thing : m_things) {
541  if(thing->isGround())
542  hasGround = true;
543  if(thing->isOnBottom())
544  hasOnBottom = true;
545  if((hasGround || hasOnBottom) && !hasIgnoreLook)
546  return true;
547  }
548  return false;
549 }
550 
552 {
553  return m_things.size() == 0;
554 }
555 
557 {
558  return !m_things.empty() || !m_walkingCreatures.empty() || !m_effects.empty();
559 }
560 
562 {
563  for(const ThingPtr& thing : m_things)
564  if(thing->isHookEast())
565  return true;
566  return false;
567 }
568 
570 {
571  for(const ThingPtr& thing : m_things)
572  if(thing->isHookSouth())
573  return true;
574  return false;
575 }
576 
578 {
579  for(const ThingPtr& thing : m_things)
580  if(thing->isCreature())
581  return true;
582  return false;
583 }
584 
585 bool Tile::limitsFloorsView(bool isFreeView)
586 {
587  // ground and walls limits the view
588  ThingPtr firstThing = getThing(0);
589 
590  if(isFreeView) {
591  if(firstThing && !firstThing->isDontHide() && (firstThing->isGround() || firstThing->isOnBottom()))
592  return true;
593  } else if(firstThing && !firstThing->isDontHide() && (firstThing->isGround() || (firstThing->isOnBottom() && firstThing->blockProjectile())))
594  return true;
595  return false;
596 }
597 
598 
600 {
601  return m_walkingCreatures.empty() && m_effects.empty() && m_things.empty() && m_flags == 0 && m_minimapColor == 0;
602 }
603 
605 {
606  int elevation = 0;
607  for(const ThingPtr& thing : m_things)
608  if(thing->getElevation() > 0)
609  elevation++;
610  return elevation;
611 }
612 
613 bool Tile::hasElevation(int elevation)
614 {
615  return getElevation() >= elevation;
616 }
617 
618 void Tile::checkTranslucentLight()
619 {
620  if(m_position.z != Otc::SEA_FLOOR)
621  return;
622 
623  Position downPos = m_position;
624  if(!downPos.down())
625  return;
626 
627  TilePtr tile = g_map.getOrCreateTile(downPos);
628  if(!tile)
629  return;
630 
631  bool translucent = false;
632  for(const ThingPtr& thing : m_things) {
633  if(thing->isTranslucent() || thing->hasLensHelp()) {
634  translucent = true;
635  break;
636  }
637  }
638 
639  if(translucent)
640  tile->m_flags |= TILESTATE_TRANSLUECENT_LIGHT;
641  else
642  tile->m_flags &= ~TILESTATE_TRANSLUECENT_LIGHT;
643 }
644 
645 /* vim: set ts=4 sw=4 et :*/
Thing::isFullGround
bool isFullGround()
Definition: thing.h:116
Painter::setColor
virtual void setColor(const Color &color)
Definition: painter.h:77
thingtypemanager.h
Otc::TILE_PIXELS
@ TILE_PIXELS
Definition: const.h:29
lightview.h
Tile::getTopMultiUseThing
ThingPtr getTopMultiUseThing()
Definition: tile.cpp:445
g_map
Map g_map
Definition: map.cpp:36
Tile::isClickable
bool isClickable()
Definition: tile.cpp:535
Tile::getGroundSpeed
int getGroundSpeed()
Definition: tile.cpp:334
TPoint::y
T y
Definition: point.h:83
Tile::isDrawable
bool isDrawable()
Definition: tile.cpp:556
Position::x
int x
Definition: position.h:243
Effect
Definition: effect.h:31
Tile::isWalkable
bool isWalkable(bool ignoreCreatures=false)
Definition: tile.cpp:475
Tile::mustHookEast
bool mustHookEast()
Definition: tile.cpp:561
Tile::getTopLookThing
ThingPtr getTopLookThing()
Definition: tile.cpp:358
Tile::addThing
void addThing(const ThingPtr &thing, int stackPos)
Definition: tile.cpp:166
Tile::getTopCreature
CreaturePtr getTopCreature()
Definition: tile.cpp:389
Creature::isWalking
bool isWalking()
Definition: creature.h:121
Creature
Definition: creature.h:37
Tile::getItems
std::vector< ItemPtr > getItems()
Definition: tile.cpp:302
Tile::hasFlag
bool hasFlag(uint32 flag)
Definition: tile.h:119
LightView::addLightSource
void addLightSource(const Point &center, float scaleFactor, const Light &light)
Definition: lightview.cpp:79
Tile::clean
void clean()
Definition: tile.cpp:148
Tile::getGround
ItemPtr getGround()
Definition: tile.cpp:324
Tile::limitsFloorsView
bool limitsFloorsView(bool isFreeView=false)
Definition: tile.cpp:585
Otc::DrawItems
@ DrawItems
Definition: const.h:52
Otc::DrawGroundBorders
@ DrawGroundBorders
Definition: const.h:49
Game::getClientVersion
int getClientVersion()
Definition: game.h:316
Creature::canBeSeen
bool canBeSeen()
Definition: creature.h:125
Map::getTile
const TilePtr & getTile(const Position &pos)
Definition: map.cpp:310
Otc::MAX_ELEVATION
@ MAX_ELEVATION
Definition: const.h:30
Tile::mustHookSouth
bool mustHookSouth()
Definition: tile.cpp:569
Tile::addWalkingCreature
void addWalkingCreature(const CreaturePtr &creature)
Definition: tile.cpp:154
Tile::hasTranslucentLight
bool hasTranslucentLight()
Definition: tile.h:106
Otc::SEA_FLOOR
@ SEA_FLOOR
Definition: const.h:32
g_game
Game g_game
Definition: game.cpp:37
Tile::getThing
ThingPtr getThing(int stackPos)
Definition: tile.cpp:264
Point
TPoint< int > Point
Definition: point.h:86
Position::y
int y
Definition: position.h:244
Tile::getThingStackPos
int getThingStackPos(const ThingPtr &thing)
Definition: tile.cpp:284
Tile::removeThing
bool removeThing(ThingPtr thing)
Definition: tile.cpp:234
Tile::getMinimapColorByte
uint8 getMinimapColorByte()
Definition: tile.cpp:342
Tile::removeWalkingCreature
void removeWalkingCreature(const CreaturePtr &creature)
Definition: tile.cpp:159
Otc::DrawOnTop
@ DrawOnTop
Definition: const.h:51
LightView
Definition: lightview.h:37
Tile::canErase
bool canErase()
Definition: tile.cpp:599
Otc::DrawGround
@ DrawGround
Definition: const.h:48
Position::z
short z
Definition: position.h:245
uint16
uint16_t uint16
Definition: types.h:36
Light::intensity
uint8 intensity
Definition: thingtype.h:119
localplayer.h
Tile::draw
void draw(const Point &dest, float scaleFactor, int drawFlags, LightView *lightView=nullptr)
Definition: tile.cpp:42
uint
unsigned int uint
Definition: types.h:31
Tile::getCreatures
std::vector< CreaturePtr > getCreatures()
Definition: tile.cpp:314
Position::translated
Position translated(int dx, int dy, short dz=0) const
Definition: position.h:187
stdext::shared_object::static_self_cast
stdext::shared_object_ptr< T > static_self_cast()
Definition: shared_object.h:50
TILESTATE_PROTECTIONZONE
@ TILESTATE_PROTECTIONZONE
Definition: tile.h:36
TILESTATE_TRANSLUECENT_LIGHT
@ TILESTATE_TRANSLUECENT_LIGHT
Definition: tile.h:51
Position
Definition: position.h:33
Tile::getElevation
int getElevation() const
Definition: tile.cpp:604
Tile::getTopUseThing
ThingPtr getTopUseThing()
Definition: tile.cpp:371
Tile::Tile
Tile(const Position &position)
Definition: tile.cpp:34
Tile::isSingleDimension
bool isSingleDimension()
Definition: tile.cpp:517
Painter::resetOpacity
void resetOpacity()
Definition: painter.h:106
Tile::isFullGround
bool isFullGround()
Definition: tile.cpp:503
map.h
TPoint::x
T x
Definition: point.h:83
TILESTATE_HOUSE
@ TILESTATE_HOUSE
Definition: tile.h:44
Tile::hasElevation
bool hasElevation(int elevation=1)
Definition: tile.cpp:613
Otc::DrawEffects
@ DrawEffects
Definition: const.h:54
TILESTATE_LAST
@ TILESTATE_LAST
Definition: tile.h:53
Map::getOrCreateTile
const TilePtr & getOrCreateTile(const Position &pos)
Definition: map.cpp:294
Tile::hasThing
bool hasThing(const ThingPtr &thing)
Definition: tile.cpp:279
Tile::isFullyOpaque
bool isFullyOpaque()
Definition: tile.cpp:511
Map::getZoneColor
Color getZoneColor(tileflags_t flag)
Definition: map.cpp:396
Item
Definition: item.h:76
fontmanager.h
TILESTATE_NOLOGOUT
@ TILESTATE_NOLOGOUT
Definition: tile.h:39
Tile::getTopThing
ThingPtr getTopThing()
Definition: tile.cpp:292
Painter::resetColor
void resetColor()
Definition: painter.h:108
Position::down
bool down(int n=1)
Definition: position.h:216
Creature::draw
virtual void draw(const Point &dest, float scaleFactor, bool animate, LightView *lightView=nullptr)
Definition: creature.cpp:66
effect.h
Map::showZones
bool showZones()
Definition: map.h:201
stdext::shared_object_ptr
Definition: shared_object.h:39
tileflags_t
tileflags_t
Definition: tile.h:33
Tile::hasCreature
bool hasCreature()
Definition: tile.cpp:577
Tile::getEffect
EffectPtr getEffect(uint16 id)
Definition: tile.cpp:271
g_painter
Painter * g_painter
Definition: painter.cpp:28
Tile::isPathable
bool isPathable()
Definition: tile.cpp:495
Otc::DrawCreatures
@ DrawCreatures
Definition: const.h:53
Otc::DrawOnBottom
@ DrawOnBottom
Definition: const.h:50
Otc::DrawAnimations
@ DrawAnimations
Definition: const.h:59
Light
Definition: thingtype.h:117
game.h
Creature::isPassable
bool isPassable()
Definition: creature.h:94
Map::getZoneOpacity
float getZoneOpacity()
Definition: map.h:198
Color::teal
static const Color teal
Definition: color.h:113
protocolgame.h
Tile::MAX_THINGS
@ MAX_THINGS
Definition: tile.h:60
TPoint< int >
TILESTATE_OPTIONALZONE
@ TILESTATE_OPTIONALZONE
Definition: tile.h:38
TILESTATE_HARDCOREZONE
@ TILESTATE_HARDCOREZONE
Definition: tile.h:40
tile.h
Map::getCentralPosition
Position getCentralPosition()
Definition: map.h:236
Tile::getTopMoveThing
ThingPtr getTopMoveThing()
Definition: tile.cpp:423
Tile::isEmpty
bool isEmpty()
Definition: tile.cpp:551
Map::showZone
bool showZone(tileflags_t zone)
Definition: map.h:202
uint8
uint8_t uint8
Definition: types.h:37
Painter::setOpacity
virtual void setOpacity(float opacity)
Definition: painter.h:91
TILESTATE_REFRESH
@ TILESTATE_REFRESH
Definition: tile.h:41
Tile::isLookPossible
bool isLookPossible()
Definition: tile.cpp:527
item.h