feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a4399472.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
This commit is contained in:
@@ -11,11 +11,11 @@ const wstring StemTile::TEXTURE_ANGLED = L"stem_bent";
|
||||
|
||||
StemTile::StemTile(int id, Tile *fruit) : Bush(id)
|
||||
{
|
||||
this->fruit = fruit;
|
||||
this->fruit = fruit;
|
||||
|
||||
setTicking(true);
|
||||
float ss = 0.125f;
|
||||
this->setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, 0.25f, 0.5f + ss);
|
||||
setTicking(true);
|
||||
float ss = 0.125f;
|
||||
this->setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, 0.25f, 0.5f + ss);
|
||||
|
||||
iconAngled = NULL;
|
||||
}
|
||||
@@ -27,91 +27,93 @@ bool StemTile::mayPlaceOn(int tile)
|
||||
|
||||
void StemTile::tick(Level *level, int x, int y, int z, Random *random)
|
||||
{
|
||||
Tile::tick(level, x, y, z, random);
|
||||
if (level->getRawBrightness(x, y + 1, z) >= Level::MAX_BRIGHTNESS - 6)
|
||||
Tile::tick(level, x, y, z, random);
|
||||
if (level->getRawBrightness(x, y + 1, z) >= Level::MAX_BRIGHTNESS - 6)
|
||||
{
|
||||
|
||||
float growthSpeed = getGrowthSpeed(level, x, y, z);
|
||||
float growthSpeed = getGrowthSpeed(level, x, y, z);
|
||||
|
||||
// 4J Stu - Brought forward change from 1.2.3 to make fruit more likely to grow
|
||||
if (random->nextInt((int) (25 / growthSpeed) + 1) == 0)
|
||||
if (random->nextInt((int) (25 / growthSpeed) + 1) == 0)
|
||||
{
|
||||
int age = level->getData(x, y, z);
|
||||
if (age < 7)
|
||||
int age = level->getData(x, y, z);
|
||||
if (age < 7)
|
||||
{
|
||||
age++;
|
||||
level->setData(x, y, z, age);
|
||||
}
|
||||
age++;
|
||||
level->setData(x, y, z, age, Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (level->getTile(x - 1, y, z) == fruit->id) return;
|
||||
if (level->getTile(x + 1, y, z) == fruit->id) return;
|
||||
if (level->getTile(x, y, z - 1) == fruit->id) return;
|
||||
if (level->getTile(x, y, z + 1) == fruit->id) return;
|
||||
if (level->getTile(x - 1, y, z) == fruit->id) return;
|
||||
if (level->getTile(x + 1, y, z) == fruit->id) return;
|
||||
if (level->getTile(x, y, z - 1) == fruit->id) return;
|
||||
if (level->getTile(x, y, z + 1) == fruit->id) return;
|
||||
|
||||
int dir = random->nextInt(4);
|
||||
int xx = x;
|
||||
int zz = z;
|
||||
if (dir == 0) xx--;
|
||||
if (dir == 1) xx++;
|
||||
if (dir == 2) zz--;
|
||||
if (dir == 3) zz++;
|
||||
int dir = random->nextInt(4);
|
||||
int xx = x;
|
||||
int zz = z;
|
||||
if (dir == 0) xx--;
|
||||
if (dir == 1) xx++;
|
||||
if (dir == 2) zz--;
|
||||
if (dir == 3) zz++;
|
||||
// 4J Stu - Brought forward change from 1.2.3 to not require farmland to grow fruits
|
||||
int below = level->getTile(xx, y - 1, zz);
|
||||
if (level->getTile(xx, y, zz) == 0 && (below == Tile::farmland_Id || below == Tile::dirt_Id || below == Tile::grass_Id))
|
||||
{
|
||||
level->setTile(xx, y, zz, fruit->id);
|
||||
}
|
||||
level->setTileAndUpdate(xx, y, zz, fruit->id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void StemTile::growCropsToMax(Level *level, int x, int y, int z)
|
||||
void StemTile::growCrops(Level *level, int x, int y, int z)
|
||||
{
|
||||
level->setData(x, y, z, 7);
|
||||
int stage = level->getData(x, y, z) + Mth::nextInt(level->random, 2, 5);
|
||||
if (stage > 7) stage = 7;
|
||||
level->setData(x, y, z, stage, Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
|
||||
float StemTile::getGrowthSpeed(Level *level, int x, int y, int z)
|
||||
{
|
||||
float speed = 1;
|
||||
float speed = 1;
|
||||
|
||||
int n = level->getTile(x, y, z - 1);
|
||||
int s = level->getTile(x, y, z + 1);
|
||||
int w = level->getTile(x - 1, y, z);
|
||||
int e = level->getTile(x + 1, y, z);
|
||||
int n = level->getTile(x, y, z - 1);
|
||||
int s = level->getTile(x, y, z + 1);
|
||||
int w = level->getTile(x - 1, y, z);
|
||||
int e = level->getTile(x + 1, y, z);
|
||||
|
||||
int d0 = level->getTile(x - 1, y, z - 1);
|
||||
int d1 = level->getTile(x + 1, y, z - 1);
|
||||
int d2 = level->getTile(x + 1, y, z + 1);
|
||||
int d3 = level->getTile(x - 1, y, z + 1);
|
||||
int d0 = level->getTile(x - 1, y, z - 1);
|
||||
int d1 = level->getTile(x + 1, y, z - 1);
|
||||
int d2 = level->getTile(x + 1, y, z + 1);
|
||||
int d3 = level->getTile(x - 1, y, z + 1);
|
||||
|
||||
bool horizontal = w == this->id || e == this->id;
|
||||
bool vertical = n == this->id || s == this->id;
|
||||
bool diagonal = d0 == this->id || d1 == this->id || d2 == this->id || d3 == this->id;
|
||||
bool horizontal = w == id || e == id;
|
||||
bool vertical = n == id || s == id;
|
||||
bool diagonal = d0 == id || d1 == id || d2 == id || d3 == id;
|
||||
|
||||
for (int xx = x - 1; xx <= x + 1; xx++)
|
||||
for (int zz = z - 1; zz <= z + 1; zz++)
|
||||
for (int xx = x - 1; xx <= x + 1; xx++)
|
||||
for (int zz = z - 1; zz <= z + 1; zz++)
|
||||
{
|
||||
int t = level->getTile(xx, y - 1, zz);
|
||||
int t = level->getTile(xx, y - 1, zz);
|
||||
|
||||
float tileSpeed = 0;
|
||||
if (t == Tile::farmland_Id)
|
||||
float tileSpeed = 0;
|
||||
if (t == Tile::farmland_Id)
|
||||
{
|
||||
tileSpeed = 1;
|
||||
if (level->getData(xx, y - 1, zz) > 0) tileSpeed = 3;
|
||||
}
|
||||
tileSpeed = 1;
|
||||
if (level->getData(xx, y - 1, zz) > 0) tileSpeed = 3;
|
||||
}
|
||||
|
||||
if (xx != x || zz != z) tileSpeed /= 4;
|
||||
if (xx != x || zz != z) tileSpeed /= 4;
|
||||
|
||||
speed += tileSpeed;
|
||||
}
|
||||
speed += tileSpeed;
|
||||
}
|
||||
|
||||
if (diagonal || (horizontal && vertical)) speed /= 2;
|
||||
if (diagonal || (horizontal && vertical)) speed /= 2;
|
||||
|
||||
return speed;
|
||||
return speed;
|
||||
}
|
||||
|
||||
int StemTile::getColor(int data)
|
||||
@@ -141,16 +143,16 @@ int StemTile::getColor(LevelSource *level, int x, int y, int z)
|
||||
|
||||
void StemTile::updateDefaultShape()
|
||||
{
|
||||
float ss = 0.125f;
|
||||
this->setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, 0.25f, 0.5f + ss);
|
||||
float ss = 0.125f;
|
||||
setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, 0.25f, 0.5f + ss);
|
||||
}
|
||||
|
||||
void StemTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr<TileEntity> forceEntity) // 4J added forceData, forceEntity param
|
||||
{
|
||||
ThreadStorage *tls = (ThreadStorage *)TlsGetValue(Tile::tlsIdxShape);
|
||||
tls->yy1 = (level->getData(x, y, z) * 2 + 2) / 16.0f;
|
||||
float ss = 0.125f;
|
||||
this->setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, (float) tls->yy1, 0.5f + ss);
|
||||
tls->yy1 = (level->getData(x, y, z) * 2 + 2) / 16.0f;
|
||||
float ss = 0.125f;
|
||||
setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, (float) tls->yy1, 0.5f + ss);
|
||||
}
|
||||
|
||||
int StemTile::getRenderShape()
|
||||
@@ -159,7 +161,7 @@ int StemTile::getRenderShape()
|
||||
}
|
||||
|
||||
int StemTile::getConnectDir(LevelSource *level, int x, int y, int z)
|
||||
{
|
||||
{
|
||||
int d = level->getData(x, y, z);
|
||||
if (d < 7) return -1;
|
||||
if (level->getTile(x - 1, y, z) == fruit->id) return 0;
|
||||
@@ -170,37 +172,30 @@ int StemTile::getConnectDir(LevelSource *level, int x, int y, int z)
|
||||
}
|
||||
|
||||
/**
|
||||
* Using this method instead of destroy() to determine if seeds should be
|
||||
* dropped
|
||||
*/
|
||||
* Using this method instead of destroy() to determine if seeds should be
|
||||
* dropped
|
||||
*/
|
||||
void StemTile::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonus)
|
||||
{
|
||||
Tile::spawnResources(level, x, y, z, data, odds, playerBonus);
|
||||
Tile::spawnResources(level, x, y, z, data, odds, playerBonus);
|
||||
|
||||
if (level->isClientSide)
|
||||
if (level->isClientSide)
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Item *seed = NULL;
|
||||
if (fruit == Tile::pumpkin) seed = Item::seeds_pumpkin;
|
||||
if (fruit == Tile::melon) seed = Item::seeds_melon;
|
||||
for (int i = 0; i < 3; i++)
|
||||
Item *seed = NULL;
|
||||
if (fruit == Tile::pumpkin) seed = Item::seeds_pumpkin;
|
||||
if (fruit == Tile::melon) seed = Item::seeds_melon;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (level->random->nextInt(5 * 3) > data) continue;
|
||||
float s = 0.7f;
|
||||
float xo = level->random->nextFloat() * s + (1 - s) * 0.5f;
|
||||
float yo = level->random->nextFloat() * s + (1 - s) * 0.5f;
|
||||
float zo = level->random->nextFloat() * s + (1 - s) * 0.5f;
|
||||
shared_ptr<ItemEntity> item = shared_ptr<ItemEntity>(new ItemEntity(level, x + xo, y + yo, z + zo, shared_ptr<ItemInstance>(new ItemInstance(seed))));
|
||||
item->throwTime = 10;
|
||||
level->addEntity(item);
|
||||
}
|
||||
popResource(level, x, y, z, shared_ptr<ItemInstance>(new ItemInstance(seed)));
|
||||
}
|
||||
}
|
||||
|
||||
int StemTile::getResource(int data, Random *random, int playerBonusLevel)
|
||||
{
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int StemTile::getResourceCount(Random *random)
|
||||
|
||||
Reference in New Issue
Block a user