void Game::doUse() { if (object != verb) { if ((object.compare("terminal") || object.compare("keyboard")) && current_room == 6) { enterCode(); return; } Item toUse = player->getItem(object); if (toUse.first != "NOITEM") { if (checkAction(toUse, USE)) { cout << "What to do you want to use the " << object << " with?" << endl; cout << ">"; getline(cin, object); Item result = room_list[current_room]->getItem(object); if (checkAction(result, USE)) { room_list[current_room]->changeState(toUse.first); } else cout << "You can't use the " << toUse.first << " with the " << object << endl; } else cout << "You can't use that. " << endl; } else cout << "You don't have a " << object << endl; } else { cout << "What do you want to use?" << endl; cout << ">"; getline(cin, object); doUse(); } }
bool DrasculaEngine::verify2() { int l; if (_menuScreen) { if (pickupObject()) return true; } else { if (!strcmp(textName, "hacker") && _hasName) { if (checkAction(50)) return true; } else { for (l = 0; l < numRoomObjs; l++) { if (mouseX > x1[l] && mouseY > y1[l] && mouseX < x2[l] && mouseY < y2[l] && visible[l] == 1) { trackFinal = trackObj[l]; walkToObject = 1; gotoObject(roomObjX[l], roomObjY[l]); if (checkAction(objectNum[l])) return true; if (currentChapter == 4) break; } } } } return false; }
void Plugin::SecondInit () { if (!Backend_) return; Backend_->Start (); TrayView_->SetBackend (Backend_.get ()); connect (TrayView_, SIGNAL (hasItemsChanged ()), this, SLOT (checkAction ())); checkAction (); }
void Game::doRead() { if (object != verb) { Item toRead = player->getItem(object); if (toRead.first != "NOITEM") { if(checkAction(toRead, READ)) { if (toRead.first.compare("note") == 0) { cout << "\"Hi there, \n" "Maybe you're wondering why you're here, maybe not.\n" "Or Maybe this is all a dream and maybe, just maybe, you're trapped \n" "inside a manor and need to find your own way out.\n" "Good Luck.\"\n" << endl; } else if (toRead.first.compare("paper") == 0) cout << "\"Sometimes, vapor can help you see through things you don't see otherwise.\"\n"; } else cout << "You can't read that" << endl; } else cout << "You don't have a " << object << endl; } else { cout << "What do you want to read?" << endl; cout << ">"; getline(cin, object); doRead(); } }
void Game::doOpen() { if (object != verb) { Item toOpen = room_list[current_room]->getItem(object); if (toOpen.first != "NOITEM") { if (checkAction(toOpen, OPEN)) { if (toOpen.first.compare("locker") == 0) { room_list[current_room]->changeState(object); cout << "You opened the locker.\n There's a small lighter and a rugged paper inside it.\n" << endl; } } else cout << "You can't open that" << endl; } else cout << "You don't see a " << object << endl; } else { cout << "What do you want to open?" << endl; cout << ">"; getline(cin, object); doRead(); } }
/* The tick is current time in milliseconds, width and height * are the image dimensions to be rendered. */ void appRender(long tick, int width, int height) { int screen = (width > height)? height:width ; // seigo screen = (int)(screen * g_scale); int sx = 0; int sy = 0; sx = (int)(screen * sViewScale.x); sy = (int)(screen * sViewScale.y); screen = (int)(screen * sViewScale.scale); if (!gAppAlive) return ; // seigo5 : delete stencil settings. just clear color glClear(GL_COLOR_BUFFER_BIT); // glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // seigo clear stencil // // glEnable(GL_STENCIL_TEST); // seigo : enable stencil test // glStencilFunc(GL_ALWAYS, 1, ~0); // seigo : drawn stencil is 1 // glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); // seigo if(g_touched == 0) checkAction(); mpAnimate(aPhotoFace, tick); mpDraw(aPhotoFace, sx, sy, screen, screen); // seigo5 remove fillAlpha //fillAlpha(screen, screen); // seigo5 }
bool DrasculaEngine::checkMenuFlags() { int n = whichObject(); if (n != 0) { if (inventoryObjects[n] != 0 && checkAction(inventoryObjects[n])) return true; } return false; }
bool DrasculaEngine::checkMenuFlags() { for (int n = 0; n < 43; n++) { if (whichObject() == n) { if (inventoryObjects[n] != 0 && checkAction(inventoryObjects[n])) return true; } } return false; }
void Game::doPut() { if (object != verb) { Item toPut = player->getItem(object); if (toPut.first != "NOITEM") { if (checkAction(toPut, PUT)) { cout << "Where do you want to put the " << object << " in?" << endl; cout << ">"; getline(cin, object); Item result = room_list[current_room]->getItem(object); if (checkAction(result, PUT)) { room_list[current_room]->changeState(toPut.first); cout << "You put the " << toPut.first << " in the " << object << endl; if (toPut.first.compare("water") == 0) { player->removeItem("water"); player->pickItem(Item("bottle", { PICK, DROP, FILL })); } } else { cout << "You can't put the " << toPut.first << " in the " << object << endl; return; } } else cout << "You can't put a " << toPut.first << endl; } else cout << "You don't have a " << object << endl; } else { cout << "What do you want to put?" << endl; cout << ">"; getline(cin, object); doPut(); } }
void Game::doFill() { if (object != verb) { Item toFill = player->getItem(object); if (toFill.first != "NOITEM") { if (checkAction(toFill, FILL)) { cout << "What do you want to fill the " << object << " with?" << endl; cout << ">"; getline(cin, object); Item result = room_list[current_room]->getItem(object); if (checkAction(result, FILL)) { room_list[current_room]->changeState(toFill.first); cout << "You filled the " << toFill.first << " with " << object << endl; if (toFill.first.compare("bottle") == 0) { player->removeItem("bottle"); player->pickItem(Item("water", { PUT })); } } else { cout << "You can't fill the " << toFill.first << " with a " << object << endl; return; } } else cout << "You can't fill a " << toFill.first << endl; } else cout << "You don't have a " << object << endl; } else { cout << "What do you want to fill?" << endl; cout << ">"; getline(cin, object); doFill(); } }
void Game::doBreak() { if (object != verb) { Item toBreak = room_list[current_room]->getItem(object); if (toBreak.first != "NOITEM") { if (checkAction(toBreak, BREAK)) { cout << "What do you want to break the " << object << " with?" << endl; cout << ">"; getline(cin, object); Item result = player->getItem(object); if (checkAction(result, BREAK)) { room_list[current_room]->changeState(toBreak.first); room_list[current_room]->removeItem(toBreak.first); cout << "You broke the " << toBreak.first << " with the " << object << endl; } else { cout << "You can't break the " << toBreak.first << " with a " << object << endl; return; } } else cout << "You can't break a " << toBreak.first << endl; } else cout << "You don't have a " << object << endl; } else { cout << "What do you want to break?" << endl; cout << ">"; getline(cin, object); doBreak(); } }
void DetectingStage::updateGameplay(){ if (timeCount_ == 0){ bgm_.play(); timeCount_ = 1; } for (int i = 0; i < persons_.size(); i++){ if (persons_[i].unDetectFrame <= 180){ if (persons_[i].center.x < getWindowWidth() / 3) persons_[i].segtion = LEFT; else if (persons_[i].center.x > getWindowWidth() * 2 / 3) persons_[i].segtion = RIGHT; else persons_[i].segtion = CENTER; } } checkAction(); updateGauge(); /*timeRatio_ = (timePhub_*1.f) / ((timePhub_ + timeTalk_) * 1.f); if (currentRatio_ + 0.001f < timeRatio_) currentRatio_ += 0.001f; else if (currentRatio_ - 0.001f > timeRatio_) currentRatio_ -= 0.001f;*/ }
void Game::doPick() { if (object != verb) { Item toPick = room_list[current_room]->getItem(object); if (checkAction(toPick, PICK)) { toPick = room_list[current_room]->removeItem(object); player->pickItem(toPick); room_list[current_room]->changeState(toPick.first); cout << "You picked the " << toPick.first << "." << endl; } else cout << "You can't pick that item" << endl; } else { cout << "Which item do you want to pick?" << endl; cout << ">"; getline(cin, object); doPick(); } }
void Game::doDrop() { if (object != verb) { Item toDrop = player->getItem(object); if (toDrop.first != "NOITEM") { if (checkAction(toDrop, DROP)) { player->dropItem(toDrop.first); room_list[current_room]->dropItem(toDrop); cout << "You dropped the " << toDrop.first << endl; } else cout << "You can't drop that item." << endl; } else cout << "You don't have that item." << endl; } else { cout << "Which item do you want to drop?" << endl; cout << ">"; getline(cin, object); doDrop(); } }
void the::object::initHandlers() { if(mousePressHandler== 0 && mouseTapHandler== 0 ) { mousePressHandler = aux::engine->getInput()->addPressHandler([&](uint x, uint y) {checkAction(Action::type::PRESS,x, y);}); mouseTapHandler = aux::engine->getInput()->addTapHandler([&](uint x, uint y) {checkAction(Action::type::TAP,x, y);}); } }
void QGamepadKeyBindings::registerMonitoredAction(const QString &action) { if(!m_monitoredActions.contains(action)) m_monitoredActions.insert(action, checkAction(action)); }
/*This function will check if move from the input is possible and then if *it is, it will move the character and call the area function if needed*/ int getMove(int input) { if (input == KEY_UP) { nextPos.row--; switch (checkAction(attributeMap[nextPos.row][nextPos.column])) { /*If is possible and not exit*/ case TRUE: update(pos); charPos.row--; break; /*If is not possible and not exit*/ case FALSE: nextPos.row++; break; default: break; } } else if (input == KEY_DOWN) { nextPos.row++; switch (checkAction(attributeMap[nextPos.row][nextPos.column])) { /*If is possible and not exit*/ case TRUE: update(pos); charPos.row++; break; /*If is not possible and not exit*/ case FALSE: nextPos.row--; break; default: break; } } else if (input == KEY_LEFT) { nextPos.column--; switch (checkAction(attributeMap[nextPos.row][nextPos.column])) { /*If is possible and not exit*/ case TRUE: update(pos); charPos.column--; break; /*If is not possible and not exit*/ case FALSE: nextPos.column++; break; default: break; } } else if (input == KEY_RIGHT) { nextPos.column++; switch (checkAction(attributeMap[nextPos.row][nextPos.column])) { /*If is possible and not exit*/ case TRUE: update(pos); charPos.column++; break; /*If is not possible and not exit*/ case FALSE: nextPos.column--; break; default: break; } } else if (input == ENTER) { pMAction(board[charPos.row][charPos.column] - 48); } return 0; }
void operate(N n){ //do what needs to be done at this neuron checkAction(n); //check for action potential decay(n); //connections naturally decay, mechanism of pruning; return; }
qWarning("Keymap::checkAxisAction used without Axis type"); break; } } return 0.0; } void QGamepadKeyBindings::reset() { m_bindingsMap.clear(); m_monitoredActions.clear(); } void QGamepadKeyBindings::checkMonitoredActions() { foreach (QString action, m_monitoredActions.keys()) { int currentValue = checkAction(action); if (currentValue != m_monitoredActions.value(action, 0)) { if (currentValue) emit monitoredActionActivated(action); else emit monitoredActionDeactivated(action); //Reset stored value m_monitoredActions.insert(action, currentValue); } } } QT_END_NAMESPACE