ref #88 added hungele flora

This commit is contained in:
Andrei Yankovich 2021-07-15 18:27:26 +03:00
parent fc0b60f15f
commit 0aa2488fb0
17 changed files with 431 additions and 9 deletions

View File

@ -0,0 +1,15 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "blueegg.h"
namespace JungleLvl {
BlueEgg::BlueEgg(): Egg(AUTO_CLASS_NAME) {
setBaseColorMap("qrc:/mesh/meshes/Other/EggBlue_Base.jpg");
}
}

View File

@ -0,0 +1,24 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef BLUEEGG_H
#define BLUEEGG_H
#include "egg.h"
namespace JungleLvl {
class BlueEgg: public Egg
{
Q_OBJECT
public:
BlueEgg();
};
}
#endif // BLUEEGG_H

View File

@ -0,0 +1,28 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "egg.h"
namespace JungleLvl {
Egg::Egg(const QString name): CRAWL::IWorldItem(name)
{
QStringList mashes {
"qrc:/mesh/meshes/Other/Egg.mesh",
};
setMash(mashes[rand() % mashes.size()]);
setSize({1,1,1});
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
}
void Egg::onIntersects(const IWorldItem *) {
}
}

View File

@ -0,0 +1,30 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef EGG_H
#define EGG_H
#include <Crawl/iworlditem.h>
#include <jungle_global.h>
namespace JungleLvl {
class CRAWL_JUNGLE_LEVEL_EXPORT Egg: public CRAWL::IWorldItem
{
Q_OBJECT
public:
Egg(const QString name);
void onIntersects(const IWorldItem *);
};
}
#endif // EGG_H

View File

@ -0,0 +1,27 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "ivy.h"
namespace JungleLvl {
Ivy::Ivy(): CRAWL::IWorldItem(AUTO_CLASS_NAME) {
QStringList mashes {
"qrc:/mesh/meshes/Plant/ivy.mesh",
};
setMash(mashes[rand() % mashes.size()]);
setBaseColorMap("qrc:/mesh/meshes/Plant/Ivy_Base.jpg");
setSize({1,1,1});
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
}
void Ivy::onIntersects(const IWorldItem *) {
}
}

View File

@ -0,0 +1,27 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef IVY_H
#define IVY_H
#include <Crawl/iworlditem.h>
#include <jungle_global.h>
namespace JungleLvl {
class CRAWL_JUNGLE_LEVEL_EXPORT Ivy: public CRAWL::IWorldItem
{
Q_OBJECT
public:
Ivy();
void onIntersects(const IWorldItem *);
};
}
#endif // IVY_H

View File

@ -0,0 +1,29 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "plant.h"
namespace JungleLvl {
Plant::Plant(): CRAWL::IWorldItem(AUTO_CLASS_NAME) {
QStringList mashes {
"qrc:/mesh/meshes/Plant/Plant_1.mesh",
"qrc:/mesh/meshes/Plant/Plant_2.mesh"
};
setMash(mashes[rand() % mashes.size()]);
setBaseColorMap("qrc:/mesh/meshes/Plant/Plant_Base.jpg");
setSize({1,1,1});
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
}
void Plant::onIntersects(const IWorldItem *) {
}
}

View File

@ -0,0 +1,25 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef PLANT_H
#define PLANT_H
#include <Crawl/iworlditem.h>
#include <jungle_global.h>
namespace JungleLvl {
class CRAWL_JUNGLE_LEVEL_EXPORT Plant: public CRAWL::IWorldItem
{
Q_OBJECT
public:
Plant();
void onIntersects(const IWorldItem *);
};
}
#endif // PLANT_H

View File

@ -0,0 +1,16 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "purpleegg.h"
namespace JungleLvl {
PurpleEgg::PurpleEgg(): Egg(AUTO_CLASS_NAME) {
setBaseColorMap("qrc:/mesh/meshes/Other/EggPurple_Base.jpg");
}
}

View File

@ -0,0 +1,21 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef EGGPURPLE_H
#define EGGPURPLE_H
#include "egg.h"
namespace JungleLvl {
class PurpleEgg: public Egg
{
Q_OBJECT
public:
PurpleEgg();
};
}
#endif // EGGPURPLE_H

View File

@ -0,0 +1,15 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "redegg.h"
namespace JungleLvl {
RedEgg::RedEgg(): Egg(AUTO_CLASS_NAME) {
setBaseColorMap("qrc:/mesh/meshes/Other/EggRed_Base.jpg");
}
}

View File

@ -0,0 +1,23 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef REDEGG_H
#define REDEGG_H
#include "egg.h"
namespace JungleLvl {
class RedEgg: public Egg
{
Q_OBJECT
public:
RedEgg();
};
}
#endif // REDEGG_H

View File

@ -0,0 +1,35 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "stone.h"
namespace JungleLvl {
Stone::Stone(): CRAWL::IWorldItem(AUTO_CLASS_NAME)
{
QStringList mashes {
"qrc:/mesh/meshes/Stone/Stone_1.mesh",
"qrc:/mesh/meshes/Stone/Stone_2.mesh",
"qrc:/mesh/meshes/Stone/Stone_3.mesh",
};
setMash(mashes[rand() % mashes.size()]);
setBaseColorMap("qrc:/mesh/meshes/Stone/Stone_Base.jpg");
setNormalMap("qrc:/mesh/meshes/Stone/Stone_Normal.jpg");
setSize({1,1,1});
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
}
void Stone::onIntersects(const IWorldItem *) {
}
}

View File

@ -0,0 +1,26 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef STONE_H
#define STONE_H
#include <Crawl/iworlditem.h>
#include <jungle_global.h>
namespace JungleLvl {
class CRAWL_JUNGLE_LEVEL_EXPORT Stone: public CRAWL::IWorldItem
{
Q_OBJECT
public:
Stone();
void onIntersects(const IWorldItem *);
};
}
#endif // STONE_H

View File

@ -0,0 +1,37 @@
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "wood.h"
namespace JungleLvl {
Wood::Wood(): CRAWL::IWorldItem(AUTO_CLASS_NAME) {
QStringList mashes {
"qrc:/mesh/meshes/Wood/Wood_1.mesh",
"qrc:/mesh/meshes/Wood/Wood_2.mesh",
"qrc:/mesh/meshes/Wood/Wood_3.mesh",
"qrc:/mesh/meshes/Wood/Wood_4.mesh",
"qrc:/mesh/meshes/Wood/Wood_5.mesh",
"qrc:/mesh/meshes/Wood/Wood_6.mesh",
"qrc:/mesh/meshes/Wood/Wood_7.mesh",
"qrc:/mesh/meshes/Wood/Wood_8.mesh",
};
setMash(mashes[rand() % mashes.size()]);
setBaseColorMap("qrc:/mesh/meshes/Wood/Wood_Base.jpg");
setNormalMap("qrc:/mesh/meshes/Wood/Wood_Normal.jpg");
setRoughnessMap("qrc:/mesh/meshes/Wood/Wood_Roughness.jpg");
setSize({1,1,1});
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
}
void Wood::onIntersects(const IWorldItem *) {
}
}

View File

@ -0,0 +1,20 @@
#ifndef WOOD_H
#define WOOD_H
#include <Crawl/iworlditem.h>
#include <jungle_global.h>
namespace JungleLvl {
class CRAWL_JUNGLE_LEVEL_EXPORT Wood: public CRAWL::IWorldItem
{
Q_OBJECT
public:
Wood();
void onIntersects(const IWorldItem *);
};
}
#endif // WOOD_H

View File

@ -12,6 +12,13 @@
#include "tree.h"
#include "world.h"
#include "Crawl/iworlditem.h"
#include "ivy.h"
#include "plant.h"
#include "stone.h"
#include "wood.h"
#include "redegg.h"
#include "purpleegg.h"
#include "blueegg.h"
#include <Crawl/snake.h>
namespace JungleLvl {
@ -24,18 +31,35 @@ World::World() {
CRAWL::WorldRule *World::initWorldRules() {
return new CRAWL::WorldRule {
{0, {
{registerObject<Ground>(), 1},
{registerObject<Grees>(), 500},
{registerObject<LongGress>(), 100},
{registerObject<Tree>(), 0}
{registerObject<Ground>(), 1},
{registerObject<Grees>(), 500},
{registerObject<LongGress>(), 100}
}
},
{500, {
{registerObject<Ground>(), 1},
{registerObject<Grees>(), 500},
{registerObject<LongGress>(), 100},
{registerObject<Tree>(), 100}
{5000, {
{registerObject<Ground>(), 1},
{registerObject<Grees>(), 500},
{registerObject<LongGress>(), 100},
{registerObject<Plant>(), 20},
{registerObject<Wood>(), 25},
}
},
{10000, {
{registerObject<Ground>(), 1},
{registerObject<Grees>(), 500},
{registerObject<LongGress>(), 100},
{registerObject<Tree>(), 50},
{registerObject<Plant>(), 20},
{registerObject<Ivy>(), 25},
{registerObject<Stone>(), 25},
{registerObject<Wood>(), 25},
{registerObject<RedEgg>(), 5},
{registerObject<PurpleEgg>(), 5},
{registerObject<BlueEgg>(), 5},
}
}