Beispiel #1
0
void Actor::Load(TCODZip &zip)
{
    x_ = zip.getInt();
    y_ = zip.getInt();
    ch_ = zip.getInt();
    col_ = zip.getColor();
    name_ = strdup(zip.getString());
    blocks_ = zip.getInt();
    bool hasAttacker = zip.getInt();
    bool hasDestructible = zip.getInt();
    bool hasAi = zip.getInt();
    bool hasPickable = zip.getInt();
    bool hasContainer = zip.getInt();
    if (hasAttacker) {
        attacker_ = new Attacker(0.0f);
        attacker_->Load(zip);
    }
    if (hasDestructible) {
        destructible_ = Destructible::Create(zip);
    }
    if (hasAi) {
        ai_ = Ai::Create(zip);
    }
    if (hasPickable) {
        pickable_ = Pickable::Create(zip);
    }
    if (hasContainer) {
        container_ = new Container(0);
        container_->Load(zip);
    }
}
Beispiel #2
0
void Actor::load(TCODZip &zip) {
	x = zip.getInt();
	y = zip.getInt();
	ch = zip.getInt();
	col= zip.getColor();
	name = strdup(zip.getString());
	blocks = zip.getInt();
	bool hasAttacker = zip.getInt();
	bool hasDestructible = zip.getInt();
	bool hasAi = zip.getInt();
	bool hasPickable = zip.getInt();
	bool hasContainer = zip.getInt();
	
	if (hasAttacker) {
		attacker = new Attacker(0.0f);
		attacker->load(zip);
	}
	if (hasDestructible) {
		destructible = Destructible::create(zip);
	}
	if (hasAi) {
		ai = Ai::create(zip);
	}
	if (hasPickable) {
		pickable = Pickable::create(zip);
	}
	if (hasContainer) {
		container = new Container(0);
		container->load(zip);
	}
}
void
Actor::Load(TCODZip& zip) {
    x = zip.getInt();
    y = zip.getInt();

    code = zip.getInt();
    color = zip.getColor();

    name = _strdup(zip.getString());

	blocks = zip.getInt() != 0;
	fovOnly = zip.getInt() != 0;

	bool hasDestructible = (zip.getInt() != 0);
	bool hasAi = (zip.getInt() != 0);
	bool hasPickable = (zip.getInt() != 0);
	bool hasContainer = (zip.getInt() != 0);

    if(hasDestructible) {
        destructible = Destructible::Create(zip);
    }

    if(hasAi) {
        ai = Ai::Create(zip);
    }

    if(hasPickable) {
        pickable = Pickable::Create(zip);
    }

    if(hasContainer) {
        container = new Container(0);
        container->Load(zip);
    }
}
void Destructible::load(TCODZip &zip)
{
    maxHp = zip.getFloat();
    hp = zip.getFloat();
    defense = zip.getFloat();
    isImmortal = zip.getInt();
    corpseName = strdup(zip.getString());
}
Beispiel #5
0
void Destructible::load(TCODZip &zip) {
	maxHp = zip.getFloat();
	hp = zip.getFloat();
	baseDefense = zip.getFloat();
	totalDefense = zip.getFloat();
	corpseName = strdup(zip.getString());
	xp = zip.getInt();
}
void Destructible::load(TCODZip &zip) {
	maxHp = zip.getFloat();
	hp = zip.getFloat();
	defense = zip.getFloat();
	corpseName = _strdup(zip.getString());
	maxAp = zip.getInt();
	ap = zip.getInt();
}
Beispiel #7
0
void Gui::load(TCODZip &zip) {
	int nbMessages = zip.getInt();
	while (nbMessages > 0) {
		const char *text = zip.getString();
		TCODColor col = zip.getColor();
		message(col,text);
		nbMessages--;
	}
}
Beispiel #8
0
void Destructible::Load(TCODZip &zip)
{
    //mobileClass_.basicAttributes_.GetHealth()->SetBaseValue(zip.getFloat());
    //maxHp_ = zip.getFloat();
    //mobileClass_.basicAttributes_.GetHealth()->SetBaseValue(zip.getFloat());
    //hp_ = zip.getFloat();
    defense_ = zip.getFloat();
    corpseName_ = strdup(zip.getString());
}
void
Gui::Load(TCODZip& zip) {
    int numberOfMessages = zip.getInt();

    while(numberOfMessages > 0) {
        char* text = (char*)zip.getString();
        TCODColor color = zip.getColor();

        Message(color, text);

        numberOfMessages--;
    }
}
Beispiel #10
0
void AiChangeEffect::load(TCODZip &zip) {
    newAi = dynamic_cast<TemporaryAi*>(Ai::create(zip));
    color = zip.getColor();
    message = strdup(zip.getString());
}
Beispiel #11
0
void HealthEffect::load(TCODZip &zip) {
    amount = zip.getInt();
    color = zip.getColor();
    message = strdup(zip.getString());
}