forked from mirrors/kolyah35-minecraft-pe-0.6.1
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
53
src/world/item/crafting/ArmorRecipes.cpp
Executable file
53
src/world/item/crafting/ArmorRecipes.cpp
Executable file
|
|
@ -0,0 +1,53 @@
|
|||
#include "ArmorRecipes.h"
|
||||
#include "Recipes.h"
|
||||
#include "../../level/tile/Tile.h"
|
||||
|
||||
static RowList shapes[] = {
|
||||
// Helmet
|
||||
Recipes::Shape(
|
||||
"XXX", //
|
||||
"X X"),//
|
||||
|
||||
// Chest plate
|
||||
Recipes::Shape(
|
||||
"X X",//
|
||||
"XXX",//
|
||||
"XXX"),//
|
||||
|
||||
// Leggings
|
||||
Recipes::Shape(
|
||||
"XXX",//
|
||||
"X X",//
|
||||
"X X"),//
|
||||
|
||||
// Boots
|
||||
Recipes::Shape(
|
||||
"X X",//
|
||||
"X X")//
|
||||
};
|
||||
|
||||
void ArmorRecipes::addRecipes( Recipes* r )
|
||||
{
|
||||
int materialIds[] = {Item::leather->id, /*((Tile*)Tile::fire)->id,*/ Item::ironIngot->id, Item::emerald->id, Item::goldIngot->id};
|
||||
|
||||
const int NumMaterials = sizeof(materialIds) / sizeof(int);
|
||||
const int NumRecipes = sizeof(shapes) / sizeof(RowList);
|
||||
|
||||
Item* map[NumRecipes][NumMaterials] = {
|
||||
{Item::helmet_cloth, /*Item::helmet_chain,*/ Item::helmet_iron, Item::helmet_diamond, Item::helmet_gold},
|
||||
{Item::chestplate_cloth, /*Item::chestplate_chain,*/ Item::chestplate_iron, Item::chestplate_diamond, Item::chestplate_gold},
|
||||
{Item::leggings_cloth, /*Item::leggings_chain,*/ Item::leggings_iron, Item::leggings_diamond, Item::leggings_gold},
|
||||
{Item::boots_cloth, /*Item::boots_chain,*/ Item::boots_iron, Item::boots_diamond, Item::boots_gold},
|
||||
};
|
||||
|
||||
//const int OVERRIDDEN_MaterialCount = 2;
|
||||
for (int m = 0; m < NumMaterials; m++) {
|
||||
int materialId = materialIds[m];
|
||||
for (int t = 0; t < NumRecipes; t++) {
|
||||
Item* target = (Item*) map[t][m];
|
||||
|
||||
r->addShapedRecipe( ItemInstance(target), shapes[t],
|
||||
definition('X', Item::items[materialId]) );
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue