summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-10-02Only nether-native mobs can see through lavaRorkh1-0/+4
2021-04-12Update entity sizesTiger Wang1-1/+1
2021-04-12Fix sending incorrect date values on world changeTiger Wang1-5/+4
Yak shave: make more things use cTickTime. Fix a couple of incorrect modulo-on-millisecond-value by making them use WorldTickAge.
2021-01-12Clarify cClientHandle, cPlayer ownership semanticsTiger Wang1-2/+0
+ A cPlayer, once created, has a strong pointer to the cClientHandle. The player ticks the clienthandle. If he finds the handle destroyed, he destroys himself in turn. Nothing else can kill the player. * The client handle has a pointer to the player. Once a player is created, the client handle never outlasts the player, nor does it manage the player's lifetime. The pointer is always safe to use after FinishAuthenticate, which is also the point where cProtocol is put into the Game state that allows player manipulation. + Entities are once again never lost by constructing a chunk when they try to move into one that doesn't exist. * Fixed a forgotten Super invocation in cPlayer::OnRemoveFromWorld. * Fix SaveToDisk usage in destructor by only saving things cPlayer owns, instead of accessing cWorld.
2021-01-02Fix potential destruction crashes (#5095)Tiger Wang1-5/+1
* Fix potential destruction crashes * Fix destructors accessing destroyted objects * Fix cPlayer not destroying windows (Destroyed never called) * Tentatively fixes #4608, fixes #3236, fixes #3262 - Remove cEntity::Destroyed() and replace with cEntity::OnRemoveFromWorld() * Add missing call to OnRemoveFromWorld
2020-12-21Monsters: improve targetingTiger Wang1-1/+2
* Replace DoWithNearestPlayer with bounding box search (avoid iterating through all players in world). * Do line-of-sight checks from eye-to-eye. + Added LOS and LOS lost timer to target lost checks, in addition to distance.
2020-10-09Adding wolf breading and moving breeding functionality to cMonster (#4951)12xx121-0/+50
* added wolf breading * mpoved breeding to monster * checkstyle * fixed my IDE "helping" * removed magic number and fixed faster aging * added flooring to age manipulation * fixed copiler error * fixed typo * moved tps to Defines.h * removed the TPS constant from the lua API exposure * added inline constexpr added explanation * fixed broken build * "fixed" build Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-04-16Using Super.Mattes D1-2/+8
2020-04-02Tweak attack rangesmathiascode1-5/+5
2020-03-22Add ambient mob sounds (#4521)Mat1-1/+4
2020-03-05Stabilise MoveToWorld (#4004)Mat1-1/+3
* Stabilise MoveToWorld * Fix comments and deprecate ScheduleMoveToWorld * Enhanced thread safety for m_WorldChangeInfo * Return unique_ptr from cAtomicUniquePtr::exchange * cWorld now calls entity cEntity::OnAddToWorld and cEntity::OnRemoveFromWorld. Allows broadcasting entities added to the world from the world's tick thread. This also factors out some common code from cEntity::DoMoveToWorld and cEntity::Initialize. As a consequence, cEntity::Destroy(false) (i.e. Destroying the entity without broadcasting) is impossible. This isn't used anywhere in Cuberite so it's now deprecated. * Update entity position after removing it from the world. Fixes broadcasts being sent to the wrong chunk. * Fix style * cEntity: Update LastSentPosition when sending spawn packet * Add Wno-deprecated-declarations to the lua bindings * Kill uses of ScheduleMoveToWorld
2018-09-24Add BurnsInDaylight to Lua API and Monsters.ini (#4295)Muhammad Kaisar Arkhan1-2/+2
* Monster.h: Export SetBurnsInDaylight This commit also adds BurnsInDaylight to check if the Monster burns in daylight or not. Closes https://github.com/cuberite/cuberite/issues/4294 * MonsterConfig.cpp: Add BurnsInDaylight Closes https://github.com/cuberite/cuberite/issues/4294
2018-01-17New movement system for leashed entities (#4147)peterbell101-1/+1
* New movement system for leashed entities Entities are accelerated towards the leashed to entity as if by a spring. * Mobs now pathfind close to but not directly to the leashing entity. * Also minor comment changes
2017-08-24Use ref instead of pointerLukas Pioch1-1/+1
2017-08-23Removed outdated pathfinder comment (#3955)Safwat Halaby1-2/+1
2017-08-21Fully implemented leashes (#3798)Pablo Beltrán1-0/+48
2017-08-13Replaced includes with forward declarationsLukas Pioch1-1/+1
2017-08-07Changed entity ownership model to use smart pointersTiger Wang1-4/+10
2017-08-06Removed unneeded includes (#3902)Lukas Pioch1-2/+0
2017-08-03Remove double includes part 2 (#3890)peterbell101-1/+0
2017-08-03Removed unused forward declarations (#3888)Lukas Pioch1-1/+1
2017-05-28Fixed tracer usage in Entity physics handling. (#3720)Mattes D1-3/+3
2017-05-22Spawn eggs works againLukas Pioch1-0/+3
2017-05-21Clang 5.0 fixesLukas Pioch1-1/+1
- Added override keyword - Removed inherited member variables
2017-05-21Don't destroy monster when last target type is a player (#3721)Pablo Beltrán1-0/+5
In current Cuberite version if you are pursued by monsters you just have to disconnect and connect again to get rid of them. If no other player is in your chunk monsters will get destroyed.
2016-10-12Spectators added (#2852)bibo381-1/+1
2016-09-12APIDump: Reformatted the docs to include type information.Mattes D1-1/+1
Also fixed a bit of documentation in the CPP source.
2016-02-03cMonster::m_Target safety across worldsLogicParrot1-3/+18
2016-01-21Spiders now friendly at daylight, new cChunk functionsLogicParrot1-2/+2
2016-01-12Fix mob attack intervalLogicParrot1-1/+2
2016-01-12Tamed wolf assists owner (attack / defence)LogicParrot1-1/+1
2015-12-24PF - "Special blocks" handlingSafwat Halaby1-4/+4
2015-12-13blockheight mechanismGargaj1-2/+2
2015-12-13Decoupled cMonster and path recalc logic, re-implemented recalcSafwat Halaby1-51/+7
2015-11-29implement breedingGargaj1-0/+1
2015-11-16changed mob age from char to intJulian Laubstein1-3/+3
2015-09-28Partial revert of #2446Safwat Halaby1-2/+13
2015-08-22Fixed a position bug in the pathfinderTiger Wang1-11/+3
2015-07-31Unified the doxy-comment format.Mattes D1-7/+7
2015-07-16Spawn baby mobshallucino1-0/+2
2015-07-14Support ageable mobsHallucino1-1/+7
Move ageable stuff in Monster directly
2015-05-28AI - Sane SkeletonSafwatHalaby1-3/+6
2015-05-19Make -Werror disabling file onlytycho1-3/+3
Ad fix a load of warnings
2015-05-17Pathfinder - approximated paths when original destination unreachableSafwatHalaby1-0/+7
2015-05-09More style checking.Mattes D1-1/+1
Spaces around some operators are checked.
2015-05-06(duplicate) AI - Livestock escape fixed, water jumping fixedwiseoldman951-0/+10
2015-05-05AI - More conservative use of ResetPathFinding, fixed minor swimming / jumping bugwiseoldman951-6/+10
2015-05-04Entity improvementsTiger Wang1-32/+28
•Pathfinder improvements •Fixes #1217 •Fixes #1933 Merge remote-tracking branch 'SafwatHalaby/water2' into fixes
2015-05-03AI - Improved Mob Jumpingwiseoldman951-0/+1
2015-05-02AI - Better daylight handlingwiseoldman951-2/+2
2015-05-02PathFinding - Chunk querying optimization and improve cPath::IsSolidwiseoldman951-1/+1
2015-05-01A* Pathfinding and better monster AIwiseoldman951-8/+12
2015-01-16Converted Monster to std::chronoTycho1-5/+5
2015-01-11Initial convertion of a_Dt to std::chronoTycho1-1/+1
also refactored cWorld::m_WorldAge and cWorld::m_TimeOfDay
2014-12-18Added Entity GuardianMasy981-1/+1
2014-12-01MobSpawner fixes.Howaner1-1/+1
2014-11-29Many api fixes, add vanilla names to mob type -> string functions and mob spawner fixes.Howaner1-4/+7
2014-11-26Merge remote-tracking branch 'origin-master' into c++11Tiger Wang1-3/+5
2014-11-15Mobs: Fixed crash with terrain too high.Mattes D1-3/+5
2014-10-12convert old style casts to fix warningsSteven Riehl1-32/+28
2014-10-05Removed obsolete cMonster::eType.madmaxoft1-3/+0
Has been replaced with global eMonsterType.
2014-09-27Fixed minor style issues.madmaxoft1-1/+1
2014-09-25Fixed styleTycho1-0/+3
2014-09-19Implemented mob spawner.Howaner1-1/+1
2014-09-17Added first test to show the object can be createdTycho1-45/+9
2014-09-02Renamed SetWalkSpeed() to SetRelativeWalkSpeed()Howaner1-3/+3
2014-09-02Added the new functions to APIDump.Howaner1-2/+2
2014-09-02Added SetCustomName() to players.Howaner1-1/+2
2014-09-01Added name tagHowaner1-0/+2
2014-09-01Added CustomName to cMonster.Howaner1-1/+19
2014-08-30Added SetWalkSpeed() to cMonster.Howaner1-0/+5
2014-07-24Removed redundant semicolons and re-added warningarchshift1-1/+1
2014-07-19Monsters: Made IsUndead overridable by the respective mob classesarchshift1-1/+1
2014-07-19Fixed style: spaces after commas.madmaxoft1-1/+1
2014-07-18Monster fixesTiger Wang1-1/+0
* Fixes #1203 * Fixes #627
2014-07-18Fixed spaces before commas.madmaxoft1-3/+3
2014-07-17Basic style fixes.madmaxoft1-4/+4
2014-07-17Normalized comments.madmaxoft1-7/+7
This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2014-07-04Tailored death messagesTiger Wang1-1/+1
2014-06-19EntityEffects.x -> EntityEffect.x, Object-Oriented effectsarchshift1-2/+0
Changed effect map to take a pointer of the effect as a result.
2014-06-17Pawn: renamed HandleEntityEffects to HandleEntityEffectarchshift1-1/+1
Exported entity effect functions for ToLua and documented them in APIDesc.lua
2014-06-17Monster: added IsUndead(), undead-specific entity effectsarchshift1-0/+6
2014-04-26Fixed mobs that don't naturally spawn.archshift1-0/+1
2014-04-26Add entity invulnerableHowaner1-1/+1
2014-04-25Giants!archshift1-1/+1
Changed mfMaxplusone to mfUnhandled for readability, and fixed a default case warning.
2014-04-17Added new AI rulesTiger Wang1-2/+2
+ Added new AI rules handling cacti and large heights * Fixed cIniFile not recognising comments in cIniFile::ReadFile() * Fixed users.ini not being properly generated * Changed all instances of (int)floor(GetPosXXX()) to POSXXX_TOINT
2014-02-24Fixed Formatting, added compiler warning suppressing methods, fixed commentsTheJumper1-2/+2
2014-02-23Fixed Formatting, Added DropChances and CanPickUpLoot attributes to MonstersTheJumper1-0/+35
2014-02-23Fixed Formatting, Added DropChances and CanPickUpLoot attributes to MonstersTheJumper1-0/+32
2014-02-23Fixed Formatting, Added DropChances and CanPickUpLoot attributes to MonstersTheJumper1-10/+13
2014-02-23Fixed Formatting, Added DropChance attributes to MonstersTheJumper1-0/+20
2014-02-22Changed formatting, encapsuled armor drop, introduced better static Enchantment IDsTheJumper1-1/+7
2014-02-22Monster.h: Added doxy-comments for drop methodsTheJumper1-0/+3
2014-02-21Fixed Mob Drops, Add Rare and Uncommon Drops, Looting inflicts DropsTheJumper1-0/+3
2014-02-11Fixed #627Tiger Wang1-2/+0
- Attack() is now called from cAggressive instead of cMonster * Monsters can no longer attack through walls * Should fix last remnants of player damage after teleporting (that both STR and bearbin contributed fixes to :P)
2014-02-03Exporded World:FindClosestPlayer, Item:IsEnchantable and Monster:MoveToPosition to Lua APItonibm191-0/+1
2014-01-25Implemented fall damage for mobsTiger Wang1-2/+6
+ Implemented mobile fall damage * Formatting fixes + Defined new Position->Integer macros
2014-01-25Mob bugfixesTiger Wang1-2/+10
* Mobs no longer require constant line-of-sight to a player to remain aggravated * Fixed an ASSERT * Fixed mobs jumping * Fixed Idle state not properly using AI + Added FILE_IO_PREFIX to favicon loading + Implemented #563
2014-01-24Miscellaneous improvementsTiger Wang1-13/+9
2014-01-24Large reworking of mob code [SEE DESC]Tiger Wang1-19/+49
+ Implemented better pathfinding - Removed lots of unused variables, functions, etc. * Changed some variable types * Other miscellaneous fixes, and also completes the previous PRs
2013-12-20Sorted a few constructors to remove warnings.madmaxoft1-1/+1
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-10Bundled fixes [SEE DESC]Tiger Wang1-5/+2
* Fixed pickups spawning in an incorrect position from a JukeBox * Pickups make a popping sound in Prtcl1.7 * Arrows make a *what sort of sound does an arrow make anyway‽* when hitting a block, and a popping sound when fired * Mobs again have metadata * Fixed Prtcl1.7 not using valid JSON to kick a client * Minecarts and arrows again have metadata
2013-10-25cMonster: Improved doxycomments.madmaxoft1-2/+2
2013-10-24Renamed cMonster::GetSpawnRate() to GetSpawnDelay().madmaxoft1-2/+2
2013-10-20Fixed memory leaks in cMobCensus, moved GetSpawnRate() to cMonster.madmaxoft1-0/+3
2013-10-20Moved all MobTypesManager functions to cMonster.madmaxoft1-2/+24
This removes some of the memory leaks and is more logical in structure. Also the functions are exported to Lua.
2013-10-20Fixed loading allowed mobs in world.madmaxoft1-8/+8
2013-10-09Second round of fixesTiger Wang1-0/+6
* Implemented suggestions
2013-09-18Added moar mobs!Tiger Wang1-21/+23
+ Added dragons + Added golems + Added giants + Added horses + Added some missing items + Added missing spawn egg metas
2013-09-17Fixed undead burningTiger Wang1-1/+1
(c'mon xoft, test ya code :P)
2013-09-16Exported cMonster:GetMobType() to the Lua API.madmaxoft1-1/+3
2013-09-10Inside cMonster::getMobFamily() : replacing Polymorphism by Map, in order to remove redundancymgueydan1-1/+2
2013-09-08Implementing the MobSpawner (not used yet) that contains spawning rulesmgueydan1-1/+4
2013-09-07Adding a getType in Monster that return an enum instead of an int or charmgueydan1-1/+2
2013-09-07Adding Family for monsters : Hostile/Passive/Water/Ambientmgueydan1-0/+10
2013-09-06Moved daylight burning directly into cMonster.madmaxoft1-0/+7
2013-09-05Moved daylight burning directly into cMonster.madmaxoft1-0/+7
2013-08-19Moved entities into the Entities subfolder.madmaxoft1-1/+1
2013-08-16Replaced E_ENTITY_TYPE_XXX with cMonster::mtXXX.madmaxoft1-1/+35
Also slightly improved the spawning algorithm.
2013-07-01Rewritten entity-on-fire management ("forever on fire" bugs)madmaxoft@gmail.com1-2/+2
Fixes FS #297 and part of FS #403. Added sizes to all entities. Moved all damage-related functions from cPawn to cEntity API change: renamed cPawn:TeleportTo() to cEntity:TeleportToCoords() git-svn-id: http://mc-server.googlecode.com/svn/trunk@1635 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-22Moved physics to the cEntity class from the derivative classes (cMonster, cPickup). Added physics override to cPlayer to disable physics calculations. Fixed bug with pitch calculations on mobs.keyboard.osh@gmail.com1-6/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1400 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-13Rewritten entities so that they are owned by individual chunks and ticked within their chunk's Tick()madmaxoft@gmail.com1-8/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1385 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-21Moved the Speed member into cEntity class instead of its descendants.madmaxoft@gmail.com1-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1222 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-22MTRand reference is now passed as a Tick() parameter so that it isn't created and destroyed over and over again. All entities will handle physics (empty callback for now)madmaxoft@gmail.com1-8/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1096 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-22Reduced most mobs' constructors to oneliners by passing parameters to superclassesmadmaxoft@gmail.com1-2/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1095 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-21Added sounds to levers and mobsluksor111@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1093 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-21Reworked the IsA() / GetClass() framework to actually be useful. Added GetParentClass().madmaxoft@gmail.com1-3/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1090 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-21Refactored the TakeDamage API to take equipped weapon and armor into consideration (PvP untested)madmaxoft@gmail.com1-10/+15
http://forum.mc-server.org/showthread.php?tid=625 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1087 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-3/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: Mobs-related files in a separate subfolder, renamed.madmaxoft@gmail.com1-6/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@883 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-24Monster classes don't use cPackets. Chat messages are sent / broadcast without cPackets. BlockEntities don't use cPackets.madmaxoft@gmail.com1-8/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@783 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Almost all packets' handling is now rewritten not to use cPacket descendants elsewhere than in cClientHandle.madmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@761 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-101/+101
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-06Item-dropping code rewritten and centralized - now there's only one place to modify if we want to split or merge same-item drops: cWorld:SpawnItemPickups(). Also, mined blocks can now drop more items, and they recognize if they're being mined by the correct tool.madmaxoft@gmail.com1-3/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@561 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25Merged the composable_generator branch into the trunkmadmaxoft@gmail.com1-1/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-15No longer using pointers for Vector3(f/d/i) in cEntity's and cTracerfaketruth1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@268 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-13Rewritten most of the code for multithreading; still not 100%, but getting there. If this commit proves to be too problematic, we can always undo it.madmaxoft@gmail.com1-2/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-28- Implemented Drops from Burning animalslapayo94@gmail.com1-6/+0
- added right monster health and attack strength - refactored the Pawn/Monster/Player class a little bit - changed some namings to fit the style git-svn-id: http://mc-server.googlecode.com/svn/trunk@140 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26- improved ClosestPlayerDetection (Really the closest now ;))lapayo94@gmail.com1-1/+1
- renamed function because the old one wasn´t listing - improved some time vars so no move gets dropped when the server laggs for a few seconds git-svn-id: http://mc-server.googlecode.com/svn/trunk@124 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 - Linux compatible fixes including updated makefilemtilden@gmail.com1-0/+1
- Mersenne Twister still says uint32 but it's now signed for compatibility with random uses needing negative values - Server seed is sent to clients, but needs to be able to be signed long long later on for authentic reasons - Protocol Version is required to match to ensure client compatibility, this should probably have a settings.ini check as well as store the value there git-svn-id: http://mc-server.googlecode.com/svn/trunk@121 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-25- Fixed Bug #99 -> Mobs no longer bother you in creative modelapayo94@gmail.com1-0/+3
- refactored many things in the Monster system git-svn-id: http://mc-server.googlecode.com/svn/trunk@112 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-21- Crafting fixed in 1.0.0lapayo94@gmail.com1-0/+4
- Server compatible with the weapons and equip again. (Some Packets were incompatible) - fixed bucket bugs (not all) - Fixed clients getting crashed by wrong Pickups - fixed nearly all mob drops. (Check wheather they are burning is missing Big Grin) - maybe some other things I can´t recall atm Big Grin git-svn-id: http://mc-server.googlecode.com/svn/trunk@94 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-03MCServer c++ source filesfaketruth1-0/+85
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6