void touch( void ) { freeze(1); move_stop(1, 6, 300,1 ); sp_dir(1,4); if (&caveguy == 2) { say_stop("This looks like the place, but it's locked.", 1); say_stop("Maybe I should try knocking..", 1); unfreeze(1); return; } if (&caveguy == 3) { say_stop("I hope that damn old man gives me that spell.", 1); unfreeze(1); return; } say("It's locked.", 1); unfreeze(1); }
void main( void ) { freeze(1); freeze(¤t_sprite); say_stop("`0Welcome young BallWood.", ¤t_sprite); wait(250); say_stop("It's Smallwood sir.", 1); say_stop("`0Yes, now what did you want?", ¤t_sprite); unfreeze(1); unfreeze(¤t_sprite); }
void main( void ) { //This is the rest of the robbery int &bad1; int &bad2; int &guy; &bad1 = sp(4); &bad2 = sp(3); &guy = sp(5); int &mcounter; sp_strength(&bad1, 3); sp_strength(&bad2, 2); sp_distance(&bad1, 50); sp_distance(&bad2, 50); sp_exp(&bad1, 30); sp_exp(&bad2, 35); freeze(1); freeze(&bad1); freeze(&bad2); freeze(&guy); //Ok, now start it! wait(1000); playmidi("battle.mid"); say_stop("`3Please, I've no money, I'm just traveling light.", &guy); wait(200); say_stop("`4We'll be the judge of that, where are you headed?", &bad2); wait(200); move(&guy, 6, 455, 0); say_stop("`3I'm just passing through to Windemere sir.", &guy); wait(200); say_stop("Those are Royal Guards, what are they doing out here ...", 1); wait(200); say_stop("`4Hah, you still owe us 5 gold pieces for passing through the land.", &bad1); wait(200); move(&guy, 4, 400, 0); say_stop("`3I don't have that much sir.", &guy); wait(200); say_stop("I don't remember ever being charged.", 1); say("`4Ha ha ha ha", &bad1); say_stop("`4Ha ha ha ha", &bad2); wait(200); say("`3Someone, help!", &guy); //They attack him... sp_target(&bad1, &guy); sp_target(&bad2, &guy); unfreeze(1); unfreeze(&bad1); unfreeze(&bad2); unfreeze(&guy); }
/* * this is all a bit magic. the soc.exceptvec register is effectively * undocumented. we had to look at linux and experiment, alas. this is the * sort of thing that should be standardised as part of the cortex mpcore spec. * even intel document their equivalent procedure. */ int startcpu(uint cpu) { int i, r; ulong oldvec, rstaddr; ulong *evp = (ulong *)soc.exceptvec; /* magic */ r = 0; if (getncpus() < 2 || cpu == m->machno || cpu >= MAXMACH || cpu >= navailcpus) return -1; oldvec = *evp; l1cache->wb(); /* start next cpu w same view of ram */ *evp = rstaddr = PADDR(_vrst); /* will start cpu executing at _vrst */ coherence(); l1cache->wb(); unfreeze(cpu); for (i = 2000; i > 0 && *evp == rstaddr; i--) delay(1); if (i <= 0 || *evp != cpu) { iprint("cpu%d: didn't start!\n", cpu); stopcpu(cpu); /* make sure it's stopped */ r = -1; } *evp = oldvec; return r; }
void talk () { freeze (1); say_stop ("`%Cabbage, grapes, cake, fish and oil.", 1); say_stop ("In other words, a shopping list.", 1); unfreeze (1); }
void MSCheckPopupMenu::updateData(void) { if (MSView::model()!=0) { freeze(); const MSStringVector& aStringVector=stringVector(); unsigned currentCount(itemCount()); unsigned i; MSWidgetVector itemVector(children()); MSCheckMenuItem *pMenuItem; for (i=0;i<aStringVector.length();i++) { if (i<itemVector.length()) { pMenuItem=(MSCheckMenuItem *)itemVector(i); pMenuItem->label(aStringVector(i)); pMenuItem->state(MSFalse); } else { pMenuItem=new MSCheckMenuItem(this,aStringVector(i),0,i); pMenuItem->selectColor(_selectColor); } setItem(pMenuItem,i); } for (i=aStringVector.length();i<itemVector.length();i++) { pMenuItem=(MSCheckMenuItem *)itemVector(i); delete pMenuItem; } unfreeze(); computeSize(); } else removeAllItems(); }
void talk () { freeze (1); say_stop ("Something about king Daniel being a jerk.", 1); say_stop ("Ah, this is 'the Awful Truth', a forbidden newspaper.", 1); unfreeze (1); }
void talk () { freeze (1); say_stop ("It's a map. It looks like king Daniel's castle.", 1); say_stop ("Why would Eggeric have a map of that?", 1); unfreeze (1); }
//=========================================================================================== // Enemy::checkCollision(FreezeRay*) // Checks for a collision between the enemy and the freeze ray. If a collision is detected // and the enemy is not frozen, the enemy is frozen and no damage is done. If there is a // collision and the enemy is already frozen, the enemy is unfrozen and takes damage. If the // damage results in the enemy's health falling below 0, then an ENEMY_DEATH event is // generated (by the call to kill()) and the method returns true, returns false otherwise. //=========================================================================================== bool Enemy::checkCollision(FreezeRay* fr, bool& collide) { sf::FloatRect hb = fr->getHitbox(); collide = false; // First check the main hitbox if (hitbox.intersects(hb)) { collide = true; if (!frozen) freeze(); else { unfreeze(); if (damage(FREEZE_DAMAGE)) { kill(W_FREEZE_RAY); return true; } } return false; } // If no collision with main hitbox, check additional hitboxes if any for (int i = 0; i < nExtraHBs; i++) { if (extraHB[i].intersects(hb)) { collide = true; if (!frozen) freeze(); else { unfreeze(); if (damage(FREEZE_DAMAGE)) { kill(W_FREEZE_RAY); return true; } } return false; } } // No collisions/no death return false; }
void talk () { freeze (1); say_stop ("It's a payment confirmation.", 1); say_stop ("He bought a bomb.", 1); say_stop ("Why does he need that, it's not war?", 1); unfreeze (1); }
int process_command(Point mouse) { button *bp = buttons; while (bp && (bp->state == Hidden || !ptinrect(mouse, bp->r))) bp = bp->next; if (!bp) return 0; if (bp == undo_button) { if (nhist > 0) { nhist--; show_hist(); } } else if (bp == startover_button) { unfreeze(); nhist = 0; show_hist(); } else if (bp == freeze_button) { switch (state) { case Live: state = Frozen; freeze_button->state = On; paint_fancy_button(freeze_button); break; case Frozen: unfreeze(); break; default: break; } flush_screen(); } else if (bp == primary_buttons[Cat_change_color].b || bp == primary_buttons[Cat_change_look].b || bp == primary_buttons[Cat_change_shape].b) { set_category(bp); } else { if (bp && nhist < MAXHIST) { history[nhist++] = bp; show_hist(); } } flush_screen(); return 1; }
//================================= // Enemy::updateFreeze(float) //================================= void Enemy::updateFreeze(float dt) { freezeTimer += dt; if (freezeTimer > FREEZE_TIME) unfreeze(); else if (freezeTimer > 0.75f * FREEZE_TIME) { freezeBlinker.update(dt); sprite.setColor(sf::Color(freezeBlinker.getAlpha(), freezeBlinker.getAlpha(), 255)); } }
bool Mole::collision_squished(GameObject& ) { if (frozen) { unfreeze(); } set_state(DEAD); SoundManager::current()->play("sounds/squish.wav", get_pos()); run_dead_script(); return true; }
void talk( void ) { freeze(1); freeze(¤t_sprite); &nut = sp_dir(1, -1); if (&talker == 0) { say_stop("`3Hi, we are the giant ducks of Koka Isle.", ¤t_sprite); wait(250); say_stop("`3Who are you?", ¤t_sprite); wait(500); sp_dir(1, 2); wait(1000); sp_dir(1, &nut); wait(250); say_stop("Uh, I'm Dink.", 1); wait(250); say_stop("`3Hello Dink.", ¤t_sprite); } unfreeze(1); unfreeze(¤t_sprite); }
HitResponse BadGuy::collision_player(Player& player, const CollisionHit& ) { if(player.is_invincible()) { kill_fall(); return ABORT_MOVE; } if(frozen) unfreeze(); player.kill(false); return FORCE_MOVE; }
void talk( void ) { freeze(1); freeze(¤t_sprite); if (&story > 10) { say_stop("Hi little girl ..", 1); wait(250); say_stop("`1Hi mister, thanks for letting us all eat.", ¤t_sprite); wait(250); say_stop("You're welcome.", 1); unfreeze(1); unfreeze(¤t_sprite); return; } choice_start() "Say hi" "Ask about food" "Never mind" choice_end() if (&result == 1) { say_stop("Hi little girl ..", 1); wait(250); say_stop("`1Hi mister.", ¤t_sprite); } if (&result == 2) { say_stop("Do you get to eat much little girl?", 1); wait(250); say_stop("`1Not much lately, mommy says we can't eat that much,", ¤t_sprite); say_stop("`1because of the ducks.", ¤t_sprite); wait(250); say_stop("`1I don't like the ducks.", ¤t_sprite); } unfreeze(1); unfreeze(¤t_sprite); }
void talk( void ) { freeze(1); freeze(¤t_sprite); choice_start(); "Tell the duck to go home" "Yell at it" choice_end(); if (&result == 1) { wait(500); say_stop("Hey little duck, you gotta get home to Ethel.", 1); wait(500); say_stop("`0QUACK!!", ¤t_sprite); wait(500); } if (&result == 2) { wait(500); say_stop("You suck little duck guy, not even I run away from home.", 1); wait(250); say_stop("You should be ashamed.", 1); wait(500); say_stop("`0Bite me", ¤t_sprite); wait(250); say_stop("`0But fine, I'll go home...", ¤t_sprite); wait(500); &old_womans_duck = 2; sp_speed(¤t_sprite, 2); sp_timing(¤t_sprite, 0); move_stop(¤t_sprite, 8, -12, 1); sp_active(¤t_sprite, 0); } unfreeze(1); unfreeze(¤t_sprite); }
void pattern::loadSettings( const QDomElement & _this ) { unfreeze(); m_patternType = static_cast<PatternTypes>( _this.attribute( "type" ).toInt() ); setName( _this.attribute( "name" ) ); if( _this.attribute( "pos" ).toInt() >= 0 ) { movePosition( _this.attribute( "pos" ).toInt() ); } changeLength( MidiTime( _this.attribute( "len" ).toInt() ) ); if( _this.attribute( "muted" ).toInt() != isMuted() ) { toggleMute(); } clearNotes(); QDomNode node = _this.firstChild(); while( !node.isNull() ) { if( node.isElement() && !node.toElement().attribute( "metadata" ).toInt() ) { note * n = new note; n->restoreState( node.toElement() ); m_notes.push_back( n ); } node = node.nextSibling(); } m_steps = _this.attribute( "steps" ).toInt(); if( m_steps == 0 ) { m_steps = MidiTime::stepsPerTact(); } ensureBeatNotes(); checkType(); /* if( _this.attribute( "frozen" ).toInt() ) { freeze(); }*/ emit dataChanged(); updateBBTrack(); }
void talk( void ) { if (&story > 10) { say_stop("`%Super-Fry Chicken opening soon.", ¤t_sprite); return; } freeze(1); say_stop("`%Hear ye, hear ye ...", ¤t_sprite); say_stop("`%By order of our great ducks the monthly tax shall be doubled.", ¤t_sprite); say_stop("`%This also applies to food donations.", ¤t_sprite); say_stop("`%Long live the ducks.", ¤t_sprite; unfreeze(1); }
void talk( void ) { freeze(1); say_stop("`0To get passage on the boat with Death", ¤t_sprite); say_stop("`0please order the full version.", ¤t_sprite); wait(200); say_stop("`0You'll be glad you did!", ¤t_sprite); move_stop(1, 2, 147, 1); wait(200); say_stop("Buy me please!", 1); if(&story > 4) { say_stop("My Mom's dead and I need a home.", 1); } unfreeze(1); }
void patternView::constructContextMenu( QMenu * _cm ) { QAction * a = new QAction( embed::getIconPixmap( "piano" ), tr( "Open in piano-roll" ), _cm ); _cm->insertAction( _cm->actions()[0], a ); connect( a, SIGNAL( triggered( bool ) ), this, SLOT( openInPianoRoll() ) ); _cm->insertSeparator( _cm->actions()[1] ); _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "edit_erase" ), tr( "Clear all notes" ), m_pat, SLOT( clear() ) ); _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ), this, SLOT( resetName() ) ); _cm->addAction( embed::getIconPixmap( "edit_rename" ), tr( "Change name" ), this, SLOT( changeName() ) ); _cm->addSeparator(); bool freeze_separator = false; if( !( m_pat->m_instrumentTrack->isMuted() || m_pat->isMuted() ) ) { _cm->addAction( embed::getIconPixmap( "freeze" ), m_pat->m_frozenPattern ? tr( "Refreeze" ) : tr( "Freeze" ), m_pat, SLOT( freeze() ) ); freeze_separator = true; } if( m_pat->m_frozenPattern ) { _cm->addAction( embed::getIconPixmap( "unfreeze" ), tr( "Unfreeze" ), m_pat, SLOT( unfreeze() ) ); freeze_separator = true; } if( freeze_separator ) { _cm->addSeparator(); } _cm->addAction( embed::getIconPixmap( "step_btn_add" ), tr( "Add steps" ), m_pat, SLOT( addSteps() ) ); _cm->addAction( embed::getIconPixmap( "step_btn_remove" ), tr( "Remove steps" ), m_pat, SLOT( removeSteps() ) ); }
bool snapshot () { nosnapshot (); if (! freeze ()) return false; setPixelCoords (true); glGenTextures (1, &snapshotTextureName); int w = winWidth; int h = winHeight; if (! NPOT_textures) { w = getNextPOT(winWidth); h = getNextPOT(winHeight); snapTexW = ((double)winWidth) / w; snapTexH = ((double)winHeight) / h; } glBindTexture(GL_TEXTURE_2D, snapshotTextureName); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); texImage2D (GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, snapshotTextureName); // Render scene glDepthMask (GL_TRUE); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen glDepthMask (GL_FALSE); drawBackDrop (); // Draw the room drawZBuffer(cameraX, cameraY, false); glEnable(GL_DEPTH_TEST); drawPeople (); // Then add any moving characters... glDisable(GL_DEPTH_TEST); viewSpeech (); // ...and anything being said drawStatusBar (); // Copy Our ViewPort To The Texture copyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, viewportOffsetX, viewportOffsetY, winWidth, winHeight, snapshotTextureName); setPixelCoords (false); unfreeze (false); return true; }
bool GraphicsManager::saveThumbnail(Common::WriteStream *stream) { stream->writeUint32LE(thumbWidth); stream->writeUint32LE(thumbHeight); if (thumbWidth && thumbHeight) { if (!freeze()) return false; if(!Image::writePNG(*stream, _renderSurface)) return false; unfreeze(true); } stream->writeByte('!'); return true; }
HitResponse BadGuy::collision_bullet(Bullet& bullet, const CollisionHit& hit) { if (is_frozen()) { if (bullet.get_type() == FIRE_BONUS) { // fire bullet thaws frozen badguys unfreeze(); bullet.remove_me(); return ABORT_MOVE; } else { // other bullets ricochet bullet.ricochet(*this, hit); return FORCE_MOVE; } } else if (is_ignited()) { if (bullet.get_type() == ICE_BONUS) { // ice bullets extinguish ignited badguys extinguish(); bullet.remove_me(); return ABORT_MOVE; } else { // other bullets are absorbed by ignited badguys bullet.remove_me(); return FORCE_MOVE; } } else if (bullet.get_type() == FIRE_BONUS && is_flammable()) { // fire bullets ignite flammable badguys ignite(); bullet.remove_me(); return ABORT_MOVE; } else if (bullet.get_type() == ICE_BONUS && is_freezable()) { // ice bullets freeze freezable badguys freeze(); bullet.remove_me(); return ABORT_MOVE; } else { // in all other cases, bullets ricochet bullet.ricochet(*this, hit); return FORCE_MOVE; } }
void MSLayout::naturalSize(void) { freeze(); MSNodeItem *hp=childListHead(); MSNodeItem *np=hp; MSLayoutEntry *entry; while ((np=np->next())!=hp) { entry=(MSLayoutEntry *) np->data(); entry->widget()->naturalSize(); } int w=label()->width(); label()->freeze(); label()->naturalSize(); unfreeze(); label()->unfreeze(); if (w!=label()->width()) label()->redraw(); }
void do_idle(void) { int i; struct timeval now; if (refresh_screen) { draw_screen(); refresh_screen = 0; gettimeofday(&last_busy, 0); } switch (state) { case AttractLoop: if (over_fps(2)) return; grab_video_in(); write_video_frame_zoom(video_r.min, video_in, VIDEO_ZOOM); break; case Live: if (over_fps(30)) return; grab_video_in(); memcpy(frames[0], video_in, sizeof(frames[0])); /* FALLTHROUGH */ case Frozen: for (i=0; i<nhist; i++) transform(history[i], frames[i], frames[i+1]); write_video_frame_zoom(video_r.min, &frames[nhist], VIDEO_ZOOM); gettimeofday(&now, 0); if (idletime > 0 && elapsed_time(last_busy, now) > idletime) { nhist = 0; unfreeze(); draw_screen(); state = AttractLoop; } if (fps_flag) show_fps(); break; } }
void click () { freeze (1); load_game (-1); // This is reached if the game didn't exist. sp_brain (g_dink, "person"); sp_base_idle (g_dink, "idle"); sp_base_walk (g_dink, "walk"); sp_timing (g_dink, 33); sp_speed (g_dink, 2); freeze (g_dink); move_stop (g_dink, 2, 400, 1); sp_dir (g_dink, 2); say_stop ("Continue?", g_dink); say_stop ("You haven't even started yet!", g_dink); say_stop ("Hmpf!", g_dink); move_stop (g_dink, 8, 350, 1); sp_y (g_dink, 350); sp_seq (g_dink, collection_code ("walk") + 3); sp_brain (g_dink, "repeat"); sp_brain (1, "pointer"); unfreeze (1); }
HitResponse Dispenser::collision(GameObject& other, const CollisionHit& hit) { Player* player = dynamic_cast<Player*> (&other); if(player) { // hit from above? if (player->get_bbox().p2.y < (bbox.p1.y + 16)) { collision_squished(*player); return FORCE_MOVE; } if(frozen){ unfreeze(); } return FORCE_MOVE; } Bullet* bullet = dynamic_cast<Bullet*> (&other); if(bullet){ return collision_bullet(*bullet, hit); } return FORCE_MOVE; }
HitResponse Dispenser::collision(GameObject& other, const CollisionHit& hit) { auto player = dynamic_cast<Player*> (&other); if (player) { // hit from above? if (player->get_bbox().get_bottom() < (m_col.m_bbox.get_top() + 16)) { collision_squished(*player); return FORCE_MOVE; } if (m_frozen && m_type != DispenserType::CANNON){ unfreeze(); } return FORCE_MOVE; } auto bullet = dynamic_cast<Bullet*> (&other); if (bullet){ return collision_bullet(*bullet, hit); } return FORCE_MOVE; }
//TODO: Add launching velocity to certain badguys bool Dispenser::collision_squished(GameObject& object) { //Cannon launching MrRocket can be broken by jumping on it //other dispensers are not that fragile. if (broken || type != DT_ROCKETLAUNCHER) { return false; } if (frozen) { unfreeze(); } sprite->set_action(dir == LEFT ? "broken-left" : "broken-right"); dispense_timer.start(0); set_colgroup_active(COLGROUP_MOVING_STATIC); // Tux can stand on broken cannon. Player* player = dynamic_cast<Player*>(&object); if (player){ player->bounce(*this); } SoundManager::current()->play("sounds/squish.wav", get_pos()); broken = true; return true; }