Beispiel #1
0
// Checks if the person is healthy
// returns true if yes, and false if no
bool Person::checkForHealth()
{
	int tmpStrength = getStrength();
	setStrength(tmpStrength--);

	// if not dead
	if (!isDead())
	{
		bool isSuccessful = isTruePctMarker(getImmunity());

		if (isSuccessful)
		{
			successHealth++;
		}

		if (3 == successHealth)
		{
			successHealth = 0;
			return true;
		}
		else
		{
			successHealth = 0;
		}
	}

	return false;
}
Beispiel #2
0
Human::Human( double money, std::map<std::string, double>& preFlop, std::string name ) : mFold( false ),
mBust( false ), mAllIn( false ), mRaised( false ), mPosition( 0 ), mStrength( 0 ), mDecision( 0 ), mRaiseAmount( 0 ),
mPlayersLeft( 0 ), mOdds( 0 )
{
	mMoney = money;
	mPreFlop = preFlop;
	mName = name;
	setStrength( );
}
Beispiel #3
0
Actor::Actor(const char * nFirst, const char * nLast)
{
	setName("actor");
	setNameFirst(nFirst);
	setNameLast(nLast);
	setIdentifier(ID_ACTOR);
	// setPrintChar('@');
	setStrength(25);
}
Beispiel #4
0
//special move sets strength back to 8 and prints what it did
void Goblin::specialMove(std::ofstream &battleLog)
{
    setStrength(8);
    std::cout << this->creatureName << " has regenerated full strength! "
                << "Goblin strength is " << this->strength << std::endl;

    battleLog << this->creatureName << " has regenerated full strength! "
                << "Goblin strength is " << this->strength << std::endl;
}
Beispiel #5
0
void Brush::setMode(Brush::mode_t mode)
{
    if(!m_group) return;
    stopStroke();
    m_mode = mode;
    setSize(m_settings[mode].size);
    setStrength(m_settings[mode].strength);
    setHardness(m_settings[mode].hardness);
    m_drawer->showHeightMarker(m_mode == M_HEIGHT_FLATTEN);
}
Beispiel #6
0
Player :: Player(Dungeon *pp, int r, int c)
: Actor (pp, r, c)
{
    max_health = 20;
    setHealth(20);
    setDexterity(2);
    setSleep(0);
    setArmor(2);
    setStrength(2);
    
    equiped = new ShortSword(r,c);
    Inventory.push_back(equiped);
    
}
void Clone::debugShader(ofTexture &tex, ofTexture &mask){

    debugFbo.allocate(buffer.getWidth(), buffer.getHeight());
    debugResultFbo.allocate(buffer.getWidth(), buffer.getHeight());
    ofShader debugShader;
    debugShader.load("shader/maskBlurShader");
    
    setStrength(16);
    

    debugFbo.begin();
    
//    debugShader.begin();
//    
//    //maskBlurShader.setUniformTexture("tex", tex, 1);
//    debugShader.setUniformTexture("tex0", tex, 1);
//    debugShader.setUniformTexture("mask", mask, 2);
//    debugShader.setUniform2f("direction", 0, 1);
//    debugShader.setUniform1i("k", strength);
//    mask.draw(0, 0);
//    
//    debugShader.end();
    maskBlurShader.begin();
    maskBlurShader.setUniformTexture("tex0", tex, 1);
    maskBlurShader.setUniformTexture("mask", mask, 2);
    //maskBlurShader.setUniform2f("direction", 0., 1./tex.getHeight());
    maskBlurShader.setUniform2f("direction", 1./tex.getWidth(), 0.);
    maskBlurShader.setUniform1i("k", strength);
    tex.draw(0, 0);
    maskBlurShader.end();
    
    
    debugFbo.end();
    
//    debugResultFbo.begin();
//    
//    maskBlurShader.setUniformTexture("tex0", debugFbo, 1);
//    maskBlurShader.setUniformTexture("mask", mask, 2);
//    maskBlurShader.setUniform2f("direction", 0., 1./tex.getHeight());
//    maskBlurShader.setUniform1i("k", strength);
//    debugFbo.draw(0, 0);
//    
//    debugResultFbo.end();
    
    
}
int QGraphicsColorizeEffect::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QGraphicsEffect::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 4)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 4;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QColor*>(_v) = color(); break;
        case 1: *reinterpret_cast< qreal*>(_v) = strength(); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setColor(*reinterpret_cast< QColor*>(_v)); break;
        case 1: setStrength(*reinterpret_cast< qreal*>(_v)); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 2;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Beispiel #9
0
void Brush::setStrength(int x)
{
    setStrength(static_cast<float>(x)/10.0f);
}
Beispiel #10
0
void Brush::setStrength(double x) { setStrength(static_cast<float>(x)); }
Beispiel #11
0
 demon::demon(int newStrength, int newHitpoints)
 {
     setStrength(newStrength);
     setHitpoints(newHitpoints);
 }
Beispiel #12
0
 demon::demon()
 {
     setStrength(10);
     setHitpoints(10);
 }
Beispiel #13
0
void Barbarian::updateStrength(int value)
{
  setStrength( strength() + value );
}
Beispiel #14
0
Sheep::Sheep() : Animal("type.Sheep") {
    setStrength(4);
    setInitiative(4);
    m_color = QVector4D(1.0, 1.0, 1.0, 1.0);
}