Asgarath83 Posted January 13, 2016 Share Posted January 13, 2016 Hello.I am doing an AOE glacial force power attack, that freeze all enemy around the jedi for a lot of second. (20 second in this case)because i have some problem (i not know exactly how to make a freezing code that can freeze more entities together) i used the BS_CINEMATIC status for freeze the enemy and i turned off they sabers. this work however sufficiently good.my trouble is... how can i Unfreeze that when the force power time is over? I need to turning theyself to BS_DEFAULT state.here's the code part related. // Humans and mortal creatures. // Damaged and frosted for 20 second, they cannot move! case CLASS_RODIAN: case CLASS_PRISONER: case CLASS_TRANDOSHAN: case CLASS_STORMTROOPER: case CLASS_IMPWORKER: case CLASS_IMPERIAL: if ( push_list[x]->enemy ) { G_ClearEnemy( push_list[x] ); } push_list[x]->NPC->confusionTime = level.time + WaterGlyphTime[self->client->ps.forcePowerLevel[FP_WATERGLYPH]]; // push_list[x]->client->ps.forcePowerDebounce[FP_WATERGLYPH] = level.time + WaterGlyphTime[self->client->ps.forcePowerLevel[FP_WATERGLYPH]]; soundIndex = G_SoundIndex( va("sound/weapons/Dark_Reaver/darkreavershadows%d.wav", Q_irand( 1, 4 ) ) ); if ( push_list[x]->ghoul2.size() && push_list[x]->torsoBolt != -1 ) {//FIXME: what if already playing effect? G_PlayEffect( G_EffectIndex( "force/frost" ), push_list[x]->playerModel, push_list[x]->chestBolt, push_list[x]->s.number, push_list[x]->currentOrigin, WaterGlyphTime[self->client->ps.forcePowerLevel[FP_WATERGLYPH]], qtrue ); G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/frost.mp3" ); G_PlayEffect( G_EffectIndex( "reavers/crystalimpactbody2" ), push_list[x]->playerModel, push_list[x]->chestBolt, push_list[x]->s.number, push_list[x]->currentOrigin ); G_Damage( push_list[x], self, self, 0, push_list[x]->client->renderInfo.torsoPoint, 75/*600*/, DAMAGE_NO_KNOCKBACK, MOD_REPEATER_ALT ); if ( push_list[x]->s.weapon == WP_SABER ) { //turn it off? push_list[x]->client->ps.SaberDeactivate(); } } if ( PM_HasAnimation( push_list[x], BOTH_COWER1 ) ) {// FREEZE ANIMATION NPC_SetAnim( push_list[x], SETANIM_LEGS, BOTH_COWER1, SETANIM_FLAG_NORMAL ); NPC_SetAnim( push_list[x], SETANIM_TORSO, BOTH_COWER1, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD ); push_list[x]->client->ps.torsoAnimTimer += 200; hold = level.time + WaterGlyphTime[self->client->ps.forcePowerLevel[FP_WATERGLYPH]]; // Freeze For 20 Sec! push_list[x]->client->ps.weaponTime = push_list[x]->client->ps.torsoAnimTimer; push_list[x]->NPC->tempBehavior = BS_CINEMATIC, WaterGlyphTime[self->client->ps.forcePowerLevel[FP_WATERGLYPH]], qtrue; //Freezing time... this not work //self->client->ps.forcePowerDebounce[FP_WATERGLYPH] = level.time + 20000; //self->client->ps.forcePowerDuration[FP_WATERGLYPH] = level.time + 20000; }; Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now