| 10919 | } |
| 10920 | |
| 10921 | void actParticleTimer(Entity* my) |
| 10922 | { |
| 10923 | if ( PARTICLE_LIFE < 0 ) |
| 10924 | { |
| 10925 | if ( multiplayer != CLIENT ) |
| 10926 | { |
| 10927 | if ( my->particleTimerEndAction == PARTICLE_EFFECT_INCUBUS_TELEPORT_STEAL ) |
| 10928 | { |
| 10929 | // teleport to random location spell. |
| 10930 | Entity* parent = uidToEntity(my->parent); |
| 10931 | if ( parent ) |
| 10932 | { |
| 10933 | createParticleErupt(parent, my->particleTimerEndSprite); |
| 10934 | |
| 10935 | int x1 = 0; |
| 10936 | int x2 = 0; |
| 10937 | int y1 = 0; |
| 10938 | int y2 = 0; |
| 10939 | if ( Stat* stats = parent->getStats() ) |
| 10940 | { |
| 10941 | if ( stats->type == INCUBUS && stats->getAttribute("special_npc") == "johann" ) |
| 10942 | { |
| 10943 | if ( !strcmp(map.filename, "fraternity.lmp") ) |
| 10944 | { |
| 10945 | x1 = 17; |
| 10946 | y1 = 1; |
| 10947 | x2 = 30; |
| 10948 | y2 = 12; |
| 10949 | } |
| 10950 | } |
| 10951 | } |
| 10952 | if ( parent->teleportRandom(x1, x2, y1, y2) ) |
| 10953 | { |
| 10954 | // teleport success. |
| 10955 | if ( multiplayer == SERVER ) |
| 10956 | { |
| 10957 | serverSpawnMiscParticles(parent, PARTICLE_EFFECT_ERUPT, my->particleTimerEndSprite); |
| 10958 | } |
| 10959 | } |
| 10960 | } |
| 10961 | } |
| 10962 | else if ( my->particleTimerEndAction == PARTICLE_EFFECT_INCUBUS_TELEPORT_TARGET ) |
| 10963 | { |
| 10964 | // teleport to target spell. |
| 10965 | Entity* parent = uidToEntity(my->parent); |
| 10966 | Entity* target = uidToEntity(static_cast<Uint32>(my->particleTimerTarget)); |
| 10967 | if ( parent && target ) |
| 10968 | { |
| 10969 | createParticleErupt(parent, my->particleTimerEndSprite); |
| 10970 | if ( parent->teleportAroundEntity(target, my->particleTimerVariable1) ) |
| 10971 | { |
| 10972 | // teleport success. |
| 10973 | if ( multiplayer == SERVER ) |
| 10974 | { |
| 10975 | serverSpawnMiscParticles(parent, PARTICLE_EFFECT_ERUPT, my->particleTimerEndSprite); |
| 10976 | } |
| 10977 | } |
| 10978 | } |
nothing calls this directly
no test coverage detected