Cuberite Forum

Full Version: Mob limit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I think the world class should gain m_MobLimit, m_CurrentPlayers and m_CurrentMobs. If ( m_CurrentMobs * m_CurrentPlayers > m_MobLimit), then no more mobs can spawn. When a mob spawns add + 1 to m_CurrentMobs, when it is removed, remove one from it. Same thing with m_CurrentPlayers.

The mob rate should also be slower and a bit more random I think.

How does this sound?

Yeah better perhaps they also should have there own m_Health.
So we can set how much health they have.
(11-10-2011, 04:42 PM)ThuGie Wrote: [ -> ]Yeah better perhaps they also should have there own m_Health.
So we can set how much health they have.

ALL pawns already have health, so you don't need to add anything.
How do i go about setting them ?
Like chicken having 2 harts / 4 heatlh ?
(11-10-2011, 11:37 PM)ThuGie Wrote: [ -> ]How do i go about setting them ?
Like chicken having 2 harts / 4 heatlh ?

In cChicken.cpp:
Code:
cChicken::cChicken()
    : m_ChaseTime( 999999 )

{
    //LOG("SPAWNING A CHICKEN!!!!!!!!!!!!!!!!!!!!!");
    m_EMPersonality = PASSIVE;
    m_MobType = 93;
    m_Health = 4 //Hearts = m_Health / 2
GetMonsterConfig("Chicken");
}[/code]
Hey,

Thanks i'm able to set health now really nice thanks alot.
Now to make it actually be able to drop multiple items.

Client just seems to crash not sure why.
Going to do some testing as the current code does actually allow multiple drops so its somewhere in my code.
I couldn't get the game to drop raw beef without crashing the client. Anything else I tried worked just fine. I don't know why and haven't looked into it at all. I moved on to another project and stopped working with drops.
Ah i see Smile.
I do hope it get implented in the main project.
As i dont wanna have any conflict when i update or having to readd it everytime.

Edit:
Also why is this in the cMonster
Code:
    m_Health = 10;

    int RandVal = rand() % 4;
    if( RandVal == 0 )
        m_MobType = 90; // Pig
    else if( RandVal == 1 )
        m_MobType = 91; // Sheep
    else if( RandVal == 2 )
        m_MobType = 92; // Cow
    else
        m_MobType = 93; // Hen
Isnt m_mobtype defined by the monster class itself atm for me also m_Health isnt that better ?
Yes it is. The parent constructor is called before the child constructor, so the child can overwrite the m_MobType value. These values in cMonster are simply default values.
Ah i see haha then couldnt mobtype be just 93 chicken or something instead random ?
Pages: 1 2