Rabbit-1
Added Brown Rabbit model and a basic ai system. added toast variant, others have to be implemented. TODO: add other variants, add their spawn in the biomes, add IDS_RABBIT And change sounds. ADD color to the spwanegg.
@@ -438,6 +438,8 @@ enum eMinecraftColour
|
||||
eMinecraftColour_Mob_Witch_Colour2,
|
||||
eMinecraftColour_Mob_Horse_Colour1,
|
||||
eMinecraftColour_Mob_Horse_Colour2,
|
||||
eMinecraftColour_Mob_Rabbit_Colour1,
|
||||
eMinecraftColour_Mob_Rabbit_Colour2,
|
||||
|
||||
eMinecraftColour_Armour_Default_Leather_Colour,
|
||||
|
||||
|
||||
@@ -256,6 +256,9 @@ const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
|
||||
L"Mob_Witch_Colour2",
|
||||
L"Mob_Horse_Colour1",
|
||||
L"Mob_Horse_Colour2",
|
||||
L"Mob_Rabbit_Colour1",
|
||||
L"Mob_Rabbit_Colour2",
|
||||
|
||||
|
||||
L"Armour_Default_Leather_Colour",
|
||||
L"Under_Water_Clear_Colour",
|
||||
|
||||
@@ -392,9 +392,11 @@ void IUIScene_CreativeMenu::staticCtor()
|
||||
ITEM_AUX(Item::spawnEgg_Id, 96); // Mooshroom
|
||||
ITEM_AUX(Item::spawnEgg_Id, 98); // Ozelot
|
||||
ITEM_AUX(Item::spawnEgg_Id, 100); // Horse
|
||||
|
||||
ITEM_AUX(Item::spawnEgg_Id, 100 | ((EntityHorse::TYPE_DONKEY + 1) << 12) ); // Donkey
|
||||
ITEM_AUX(Item::spawnEgg_Id, 100 | ((EntityHorse::TYPE_MULE + 1) << 12)); // Mule
|
||||
ITEM_AUX(Item::spawnEgg_Id, 120); // Villager
|
||||
ITEM_AUX(Item::spawnEgg_Id, 101); // Rabbit Brown
|
||||
ITEM(Item::record_01_Id)
|
||||
ITEM(Item::record_02_Id)
|
||||
ITEM(Item::record_03_Id)
|
||||
|
||||
|
After Width: | Height: | Size: 503 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 513 B |
|
After Width: | Height: | Size: 519 B |
|
After Width: | Height: | Size: 588 B |
|
After Width: | Height: | Size: 598 B |
|
After Width: | Height: | Size: 512 B |
|
After Width: | Height: | Size: 625 B |
|
After Width: | Height: | Size: 503 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 513 B |
|
After Width: | Height: | Size: 519 B |
|
After Width: | Height: | Size: 588 B |
|
After Width: | Height: | Size: 598 B |
|
After Width: | Height: | Size: 512 B |
|
After Width: | Height: | Size: 625 B |
@@ -82,6 +82,7 @@
|
||||
#include "ZombieRenderer.h"
|
||||
#include "BatRenderer.h"
|
||||
#include "CaveSpiderRenderer.h"
|
||||
#include "RabbitRenderer.h"
|
||||
|
||||
double EntityRenderDispatcher::xOff = 0.0;
|
||||
double EntityRenderDispatcher::yOff = 0.0;
|
||||
@@ -132,6 +133,8 @@ EntityRenderDispatcher::EntityRenderDispatcher()
|
||||
|
||||
renderers[eTYPE_WITHERBOSS] = new WitherBossRenderer();
|
||||
|
||||
renderers[eTYPE_RABBIT] = new RabbitRenderer();
|
||||
|
||||
renderers[eTYPE_ENTITY] = new DefaultRenderer();
|
||||
renderers[eTYPE_PAINTING] = new PaintingRenderer();
|
||||
renderers[eTYPE_ITEM_FRAME] = new ItemFrameRenderer();
|
||||
|
||||
@@ -20711,6 +20711,8 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
</ClInclude>
|
||||
<ClInclude Include="PSVita\Social\SocialManager.h" />
|
||||
<ClInclude Include="PSVita\XML\ATGXmlParser.h" />
|
||||
<ClInclude Include="RabbitModel.h" />
|
||||
<ClInclude Include="RabbitRenderer.h" />
|
||||
<ClInclude Include="ReceivingLevelScreen.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">true</ExcludedFromBuild>
|
||||
@@ -37928,6 +37930,8 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RabbitModel.cpp" />
|
||||
<ClCompile Include="RabbitRenderer.cpp" />
|
||||
<ClCompile Include="ReceivingLevelScreen.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">true</ExcludedFromBuild>
|
||||
|
||||
@@ -3793,6 +3793,12 @@
|
||||
<ClInclude Include="..\include\lce_filesystem\lce_filesystem.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RabbitModel.h">
|
||||
<Filter>net\minecraft\client\model</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RabbitRenderer.h">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
@@ -5949,6 +5955,12 @@
|
||||
<ClCompile Include="..\include\lce_filesystem\lce_filesystem.cpp">
|
||||
<Filter>include\lce_filesystem</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RabbitModel.cpp">
|
||||
<Filter>net\minecraft\client\model</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RabbitRenderer.cpp">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Library Include="Xbox\4JLibs\libs\4J_Render_d.lib">
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
#include "stdafx.h"
|
||||
#include "RabbitModel.h"
|
||||
#include "ModelPart.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "../Minecraft.World/Rabbit.h"
|
||||
|
||||
#define PI 3.14159265358979323846f
|
||||
|
||||
RabbitModel::RabbitModel() : Model()
|
||||
{
|
||||
this->texWidth = 64;
|
||||
this->texHeight = 32;
|
||||
|
||||
// head part
|
||||
head = new ModelPart(this, 32, 0);
|
||||
head->addBox(-2.5F, -4.0F, -5.0F, 5, 4, 5);
|
||||
head->setPos(0.0F, 16.0F, -1.0F);
|
||||
|
||||
rightEar = new ModelPart(this, 52, 0);
|
||||
rightEar->addBox(-2.5F, -9.0F, -1.0F, 2, 5, 1);
|
||||
rightEar->setPos(0.0F, 0.0F, 0.0F);
|
||||
rightEar->yRot = -PI / 12.0f;
|
||||
|
||||
leftEar = new ModelPart(this, 58, 0);
|
||||
leftEar->addBox(0.5F, -9.0F, -1.0F, 2, 5, 1);
|
||||
leftEar->setPos(0.0F, 0.0F, 0.0F);
|
||||
leftEar->yRot = PI / 12.0f;
|
||||
|
||||
nose = new ModelPart(this, 32, 9);
|
||||
nose->addBox(-0.5F, -2.5F, -5.5F, 1, 1, 1);
|
||||
nose->setPos(0.0F, 0.0F, 0.0F);
|
||||
|
||||
head->addChild(rightEar);
|
||||
head->addChild(leftEar);
|
||||
head->addChild(nose);
|
||||
|
||||
// body part
|
||||
body = new ModelPart(this, 0, 0);
|
||||
body->addBox(-3.0F, -2.0F, -10.0F, 6, 5, 10);
|
||||
body->setPos(0.0F, 19.0F, 8.0F);
|
||||
body->xRot = -PI / 9.0f;
|
||||
|
||||
tail = new ModelPart(this, 52, 6);
|
||||
tail->addBox(-1.5F, -1.5F, 0.0F, 3, 3, 2);
|
||||
tail->setPos(0.0F, 20.0F, 7.0F);
|
||||
tail->xRot = -0.3490659F;
|
||||
|
||||
// front legs
|
||||
leftHindThigh = new ModelPart(this, 30, 15);
|
||||
leftHindThigh->addBox(-1.0F, 0.0F, 0.0F, 2, 4, 5);
|
||||
leftHindThigh->setPos(3.0F, 17.5F, 3.7F);
|
||||
leftHindThigh->xRot = -0.36651915F;
|
||||
|
||||
leftHindFoot = new ModelPart(this, 26, 24);
|
||||
leftHindFoot->addBox(-1.0F, 5.5F, -3.7F, 2, 1, 7);
|
||||
leftHindFoot->setPos(0.0F, 0.0F, 0.0F);
|
||||
leftHindFoot->xRot = 0.36651915F;
|
||||
leftHindThigh->addChild(leftHindFoot);
|
||||
|
||||
rightHindThigh = new ModelPart(this, 16, 15);
|
||||
rightHindThigh->addBox(-1.0F, 0.0F, 0.0F, 2, 4, 5);
|
||||
rightHindThigh->setPos(-3.0F, 17.5F, 3.7F);
|
||||
rightHindThigh->xRot = -0.36651915F;
|
||||
|
||||
rightHindFoot = new ModelPart(this, 8, 24);
|
||||
rightHindFoot->addBox(-1.0F, 5.5F, -3.7F, 2, 1, 7);
|
||||
rightHindFoot->setPos(0.0F, 0.0F, 0.0F);
|
||||
rightHindFoot->xRot = 0.36651915F;
|
||||
rightHindThigh->addChild(rightHindFoot);
|
||||
|
||||
// back legs
|
||||
leftFrontLeg = new ModelPart(this, 8, 15);
|
||||
leftFrontLeg->addBox(-1.0F, 0.0F, -1.0F, 2, 7, 2);
|
||||
leftFrontLeg->setPos(3.0F, 17.0F, -1.0F);
|
||||
leftFrontLeg->xRot = -0.19198622F;
|
||||
|
||||
rightFrontLeg = new ModelPart(this, 0, 15);
|
||||
rightFrontLeg->addBox(-1.0F, 0.0F, -1.0F, 2, 7, 2);
|
||||
rightFrontLeg->setPos(-3.0F, 17.0F, -1.0F);
|
||||
rightFrontLeg->xRot = -0.19198622F;
|
||||
}
|
||||
|
||||
void RabbitModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
{
|
||||
shared_ptr<Rabbit> rabbit = dynamic_pointer_cast<Rabbit>(entity);
|
||||
|
||||
// head animation
|
||||
head->xRot = xRot * (PI / 180.0f);
|
||||
head->yRot = yRot * (PI / 180.0f);
|
||||
|
||||
// jump animation
|
||||
float jumpCompletion = 0.0f;
|
||||
if (rabbit) jumpCompletion = rabbit->getJumpCompletion(bob);
|
||||
|
||||
float jumpSin = Mth::sin(jumpCompletion * PI);
|
||||
|
||||
leftHindThigh->xRot = -0.36651915F + (jumpSin * 50.0f * (PI / 180.0f));
|
||||
rightHindThigh->xRot = -0.36651915F + (jumpSin * 50.0f * (PI / 180.0f));
|
||||
leftFrontLeg->xRot = -0.19198622F + (jumpSin * -40.0f * (PI / 180.0f));
|
||||
rightFrontLeg->xRot = -0.19198622F + (jumpSin * -40.0f * (PI / 180.0f));
|
||||
|
||||
|
||||
head->render(scale, usecompiled);
|
||||
body->render(scale, usecompiled);
|
||||
tail->render(scale, usecompiled);
|
||||
leftHindThigh->render(scale, usecompiled);
|
||||
rightHindThigh->render(scale, usecompiled);
|
||||
leftFrontLeg->render(scale, usecompiled);
|
||||
rightFrontLeg->render(scale, usecompiled);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#include "Model.h"
|
||||
|
||||
class RabbitModel : public Model
|
||||
{
|
||||
private:
|
||||
ModelPart *head;
|
||||
ModelPart *nose;
|
||||
ModelPart *leftEar;
|
||||
ModelPart *rightEar;
|
||||
|
||||
ModelPart *body;
|
||||
ModelPart *tail;
|
||||
ModelPart *leftFrontLeg;
|
||||
ModelPart *rightFrontLeg;
|
||||
|
||||
ModelPart *leftHindThigh;
|
||||
ModelPart *leftHindFoot;
|
||||
ModelPart *rightHindThigh;
|
||||
ModelPart *rightHindFoot;
|
||||
|
||||
public:
|
||||
RabbitModel();
|
||||
|
||||
virtual void render(shared_ptr<Entity> entity,
|
||||
float time, float r, float bob,
|
||||
float yRot, float xRot,
|
||||
float scale, bool usecompiled) override;
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
#include "stdafx.h"
|
||||
#include "RabbitRenderer.h"
|
||||
#include "RabbitModel.h"
|
||||
#include "MobRenderer.h"
|
||||
#include "../Minecraft.World/Rabbit.h"
|
||||
|
||||
|
||||
ResourceLocation RabbitRenderer::LOC_BROWN = ResourceLocation(TN_MOB_RABBIT_BROWN);
|
||||
ResourceLocation RabbitRenderer::LOC_WHITE = ResourceLocation(TN_MOB_RABBIT_WHITE);
|
||||
ResourceLocation RabbitRenderer::LOC_BLACK = ResourceLocation(TN_MOB_RABBIT_BLACK);
|
||||
ResourceLocation RabbitRenderer::LOC_GOLD = ResourceLocation(TN_MOB_RABBIT_GOLD);
|
||||
ResourceLocation RabbitRenderer::LOC_SALT = ResourceLocation(TN_MOB_RABBIT_SALT);
|
||||
ResourceLocation RabbitRenderer::LOC_WHITE_SPLOTCHED = ResourceLocation(TN_MOB_RABBIT_WHITE_SPLOTCHED);
|
||||
ResourceLocation RabbitRenderer::LOC_TOAST = ResourceLocation(TN_MOB_RABBIT_TOAST);
|
||||
ResourceLocation RabbitRenderer::LOC_EVIL = ResourceLocation(TN_MOB_RABBIT_CAERBANNOG);
|
||||
|
||||
RabbitRenderer::RabbitRenderer() : MobRenderer(new RabbitModel(), 0.3f)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ResourceLocation *RabbitRenderer::getTextureLocation(shared_ptr<Entity> entity)
|
||||
{
|
||||
shared_ptr<Rabbit> mob = dynamic_pointer_cast<Rabbit>(entity);
|
||||
if (mob == nullptr) return &LOC_BROWN;
|
||||
|
||||
// easter egg toast
|
||||
if (mob->hasCustomName() && mob->getCustomName() == L"Toast")
|
||||
{
|
||||
return &LOC_TOAST;
|
||||
}
|
||||
|
||||
// variants
|
||||
switch (mob->getVariant())
|
||||
{
|
||||
case Rabbit::Variant::WHITE: return &LOC_WHITE;
|
||||
case Rabbit::Variant::BLACK: return &LOC_BLACK;
|
||||
case Rabbit::Variant::GOLD: return &LOC_GOLD;
|
||||
case Rabbit::Variant::SALT: return &LOC_SALT;
|
||||
case Rabbit::Variant::WHITE_SPLOTCHED: return &LOC_WHITE_SPLOTCHED;
|
||||
case Rabbit::Variant::EVIL: return &LOC_EVIL;
|
||||
case Rabbit::Variant::BROWN:
|
||||
default: return &LOC_BROWN;
|
||||
}
|
||||
}
|
||||
|
||||
void RabbitRenderer::scale(shared_ptr<LivingEntity> _mob, float a)
|
||||
{
|
||||
|
||||
glScalef(0.65f, 0.65f, 0.65f);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include "MobRenderer.h"
|
||||
|
||||
class Rabbit;
|
||||
class LivingEntity;
|
||||
|
||||
class RabbitRenderer : public MobRenderer
|
||||
{
|
||||
private:
|
||||
|
||||
static ResourceLocation LOC_BROWN;
|
||||
static ResourceLocation LOC_WHITE;
|
||||
static ResourceLocation LOC_BLACK;
|
||||
static ResourceLocation LOC_GOLD;
|
||||
static ResourceLocation LOC_SALT;
|
||||
static ResourceLocation LOC_WHITE_SPLOTCHED;
|
||||
static ResourceLocation LOC_TOAST;
|
||||
static ResourceLocation LOC_EVIL;
|
||||
|
||||
public:
|
||||
RabbitRenderer();
|
||||
|
||||
virtual ResourceLocation *getTextureLocation(shared_ptr<Entity> entity) override;
|
||||
|
||||
protected:
|
||||
virtual void scale(shared_ptr<LivingEntity> mob, float a) override;
|
||||
};
|
||||
@@ -156,6 +156,17 @@ const wchar_t *Textures::preLoaded[TN_COUNT] =
|
||||
L"mob/wither/wither_armor",
|
||||
L"mob/wither/wither_invulnerable",
|
||||
|
||||
//TU31
|
||||
L"mob/rabbit/brown",
|
||||
L"mob/rabbit/white",
|
||||
L"mob/rabbit/black",
|
||||
L"mob/rabbit/gold",
|
||||
L"mob/rabbit/salt",
|
||||
L"mob/rabbit/white_splotched",
|
||||
L"mob/rabbit/toast",
|
||||
L"mob/rabbit/caerbannog",
|
||||
|
||||
|
||||
L"item/trapped",
|
||||
L"item/trapped_double",
|
||||
//L"item/christmas",
|
||||
|
||||
@@ -146,6 +146,16 @@ typedef enum _TEXTURE_NAME
|
||||
TN_MOB_WITHER_ARMOR,
|
||||
TN_MOB_WITHER_INVULNERABLE,
|
||||
|
||||
//TU31
|
||||
TN_MOB_RABBIT_BROWN,
|
||||
TN_MOB_RABBIT_WHITE,
|
||||
TN_MOB_RABBIT_BLACK,
|
||||
TN_MOB_RABBIT_GOLD,
|
||||
TN_MOB_RABBIT_SALT,
|
||||
TN_MOB_RABBIT_WHITE_SPLOTCHED,
|
||||
TN_MOB_RABBIT_TOAST,
|
||||
TN_MOB_RABBIT_CAERBANNOG,
|
||||
|
||||
TN_TILE_TRAP_CHEST,
|
||||
TN_TILE_LARGE_TRAP_CHEST,
|
||||
//TN_TILE_XMAS_CHEST,
|
||||
|
||||