本文整理汇总了C++中effect函数的典型用法代码示例。如果您正苦于以下问题:C++ effect函数的具体用法?C++ effect怎么用?C++ effect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了effect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SubXP
void SubXP(int xp, bool quiet)
{
Weapon *weapon = &player->weapons[player->curWeapon];
bool leveled_down = false;
weapon->xp -= xp;
// leveling down...
while(weapon->xp < 0)
{
if (weapon->level > 0)
{
weapon->level--;
weapon->xp += weapon->max_xp[weapon->level];
leveled_down = true;
}
else
{
weapon->xp = 0;
break;
}
}
if (player->curWeapon == WPN_SPUR)
leveled_down = false;
if (leveled_down && !quiet && !player->hide)
{
effect(player->CenterX(), player->CenterY(), EFFECT_LEVELDOWN);
}
}
开发者ID:Angluca,项目名称:nxengine-libretro,代码行数:31,代码来源:playerstats.cpp
示例2: Base_Effect_base_event2
void Base_Effect_base_event2(PARTICLE* p) {
if(p.alpha <= 1.000) {
parted_temp_vec.x = 0.000;
parted_temp_vec.y = 0.000;
parted_temp_vec.z = 0.000;
vec_add(parted_temp_vec,p.x);
parted_temp2_vec.x = random(2.000)+(-1.000);
parted_temp2_vec.y = random(2.000)+(-1.000);
parted_temp2_vec.z = (1.000);
if(!(total_frames % 25)) {
p.skill_c += 3.000*time_step*6.25;
if(p.skill_c >= 1){
effect(New_child_child2,integer(p.skill_c),parted_temp_vec,parted_temp2_vec);
p.skill_c -= integer(p.skill_c);
}
}
}
p.alpha = clamp(p.alpha-3.000* time_step,-1,100);
if(p.size >= 11.000 || (p.skill_a & 2)) {
p.skill_a |= 2;
p.size -= 1.000* time_step;
}
if(p.size <= 3.000 || (p.skill_a & 4)) {
p.skill_a |= 4;
p.size += 1.000* time_step;
}
if(p.alpha < 0 || p.size < 0) p.lifespan = 0;
}
开发者ID:Florastamine,项目名称:craftbox,代码行数:28,代码来源:Craftbox_System_FX.c
示例3: emit_fountain1
void emit_fountain1() {
my._BEING_MANIPULATED = 0;
my.emask |= ENABLE_CLICK;
my.event = ObjectManipulationCore;
var my_time;my_time = 0;
var timetable_num;timetable_num = 0;
var eff_frac; eff_frac = 0;
wait(1);
while(my) {
my_time += time_step/16;
if(my_time >= 0.000)my_time = 0;
timetable_num = 1;
parted_temp_vec.x = 0.000;
parted_temp_vec.y = 0.000;
parted_temp_vec.z = 0.000;
vec_add(parted_temp_vec,my.x);
eff_frac += 3.000*timetable_num*time_step*6.25;
if(eff_frac >= 1){
effect(Base_Effect3_base,integer(eff_frac),parted_temp_vec,nullvector);
eff_frac -= integer(eff_frac);
}
wait(1);
}
}
开发者ID:Florastamine,项目名称:craftbox,代码行数:27,代码来源:Craftbox_System_FX.c
示例4: crLottiUpdateFly
BOOL crLottiUpdateFly (ENTITY* e)
{
VECTOR v, w;
vec_set(&w, e->crAccel);
vec_scale(&w, time_step);
vec_add(e->crSpeed, &w);
vec_set(&v, e->crSpeed);
vec_scale(&v, time_step);
vec_add(e->x, &v);
VECTOR feet;
feet.x = feet.y = 0;
feet.z = 0.5 * e->min_z;
vec_rotate(feet, e->pan);
vec_add(feet, e->x);
ent_animate(e, "drown", 5 * total_ticks + e->crInit, ANM_CYCLE);
effect(credits_fire, 2, feet, e->crSpeed);
// explode near screen border
VECTOR v;
vec_set(&v, e->x);
vec_to_screen(&v, camera);
return (v.x < e->crPercent * screen_size.x || v.x > (1 - e->crPercent) * screen_size.x ||
v.y < e->crPercent * screen_size.y || v.y > (1 - e->crPercent) * screen_size.y);
}
开发者ID:Acknex,项目名称:Prince-of-Lotteria,代码行数:34,代码来源:credits.c
示例5: eff_expl_flash
void eff_expl_flash() {
int i;
set(me, BRIGHT | TRANSLUCENT | LIGHT | ZNEAR | PASSABLE);
my.alpha = 50;
my.roll = random(360);
while(my.alpha < 100) {
my.alpha += time_step * (random(20)+20);
my.roll += time_step * sign(ang(my.roll));
vec_fill ( my.scale_x, my.alpha/13 );
wait(1);
}
for(i=0; i<4; i++) {
ent_create("explFlash01.tga", my.x, eff_expl_flash_2);
you = ent_create("explFlash02.tga", my.x, eff_expl_flash_2);
if (i == 0) set(you, LIGHT);
}
for(i=0; i<5; i++) {
ent_create ("explSmoke01.tga", my.x, eff_expl_smoke2);
}
effect(p_eff_expl_particle, 200, my.x, NULL);
vec_add(my.scale_x, vector(3,3,3));
ent_create("explSmoke02.tga", my.x, eff_expl_smoke);
while(my.alpha > 0) {
my.alpha -= time_step * 25;
my.roll += time_step * sign(ang(my.roll));
wait(1);
}
ent_remove(me);
}
开发者ID:Florastamine,项目名称:craftbox,代码行数:29,代码来源:Craftbox_System_FX.c
示例6: catch
int halo_impl::add(int x, int y, const std::string& image, const map_location& loc,
ORIENTATION orientation, bool infinite)
{
const int id = halo_id++;
animated<image::locator>::anim_description image_vector;
std::vector<std::string> items = utils::square_parenthetical_split(image, ',');
for(const std::string& item : items) {
const std::vector<std::string>& sub_items = utils::split(item, ':');
std::string str = item;
int time = 100;
if(sub_items.size() > 1) {
str = sub_items.front();
try {
time = std::stoi(sub_items.back());
} catch(std::invalid_argument) {
ERR_DP << "Invalid time value found when constructing halo: " << sub_items.back() << "\n";
}
}
image_vector.push_back(animated<image::locator>::frame_description(time,image::locator(str)));
}
haloes.insert(std::pair<int,effect>(id,effect(disp,x,y,image_vector,loc,orientation,infinite)));
new_haloes.insert(id);
if(haloes.find(id)->second.does_change() || !infinite) {
changing_haloes.insert(id);
}
return id;
}
开发者ID:xyecs,项目名称:wesnoth,代码行数:30,代码来源:halo.cpp
示例7: main
main(int ac,char *av[])
{
ImageData *img,*outimg;
int res;
int x,y,mx,my;
if(ac<3) {
printf("パラメータが足りません");
return;
}
// ファイルより画像データの読み込み
res=readBMPfile(av[1],&img);
if(res<0) {
printf("画像が読めません");
return;
}
// 結果格納用画像データ作成
outimg=createImage(img->width,img->height,24);
effect(img,outimg);
writeBMPfile(av[2],outimg);
disposeImage(img);
disposeImage(outimg);
}
开发者ID:linyungyi,项目名称:digital_iamge_processing,代码行数:28,代码来源:list5_26.c
示例8: player_particles
void player_particles()
{
VECTOR particle_pos[3];
vec_set (particle_pos.x, player.x);
particle_pos.z += 70; // place the healing particles above the characters' heads
effect(particle_void, 1, particle_pos, nullvector);
}
开发者ID:Florastamine,项目名称:craftbox,代码行数:7,代码来源:Craftbox_System_FX.c
示例9: atoi
int halo_impl::add(int x, int y, const std::string& image, const map_location& loc,
ORIENTATION orientation, bool infinite)
{
const int id = halo_id++;
animated<image::locator>::anim_description image_vector;
std::vector<std::string> items = utils::square_parenthetical_split(image, ',');
std::vector<std::string>::const_iterator itor = items.begin();
for(; itor != items.end(); ++itor) {
const std::vector<std::string>& items = utils::split(*itor, ':');
std::string str;
int time;
if(items.size() > 1) {
str = items.front();
time = atoi(items.back().c_str());
} else {
str = *itor;
time = 100;
}
image_vector.push_back(animated<image::locator>::frame_description(time,image::locator(str)));
}
haloes.insert(std::pair<int,effect>(id,effect(disp,x,y,image_vector,loc,orientation,infinite)));
new_haloes.insert(id);
if(haloes.find(id)->second.does_change() || !infinite) {
changing_haloes.insert(id);
}
return id;
}
开发者ID:Heark,项目名称:wesnoth,代码行数:29,代码来源:halo.cpp
示例10: emit_fire1
void emit_fire1() {
my._BEING_MANIPULATED = 0;
my.emask |= ENABLE_CLICK;
my.event = ObjectManipulationCore;
var my_time;my_time = 0;
var timetable_num;timetable_num = 0;
var eff_frac; eff_frac = 0;
wait(1);
while(my) {
my_time += time_step/16;
if(my_time >= 0.000)my_time = 0;
timetable_num = 1;
parted_temp_vec.x = random(20.000)+-10.000;
parted_temp_vec.y = random(20.000)+-10.000;
parted_temp_vec.z = random(5.098)+-0.098;
vec_add(parted_temp_vec,my.x);
parted_temp2_vec.x = random(0.600)+(-0.300);
parted_temp2_vec.y = random(0.600)+(-0.300);
parted_temp2_vec.z = random(0.239)+(0.261);
eff_frac += 2.000*timetable_num*time_step*6.25;
if(eff_frac >= 1){
effect(Base_Effect_base2,integer(eff_frac),parted_temp_vec,parted_temp2_vec);
eff_frac -= integer(eff_frac);
}
wait(1);
}
}
开发者ID:Florastamine,项目名称:craftbox,代码行数:30,代码来源:Craftbox_System_FX.c
示例11: main
main(int ac,char *av[])
{
ImageData *img,*outimg;
int res;
int x,y,mx,my;
if(ac<4) {
printf("パ??ータが足りません");
return;
}
res=readBMPfile(av[1],&img);
if(res<0) {
printf("画?が読めません");
return;
}
outimg=createImage(img->width,img->height,24);
effect(img,outimg,atoi(av[3]));
writeBMPfile(av[2],outimg);
disposeImage(img);
disposeImage(outimg);
}
开发者ID:linyungyi,项目名称:digital_iamge_processing,代码行数:28,代码来源:list3_04.c
示例12: effect
void EffectView::editControls()
{
if( m_subWindow )
{
if( !m_subWindow->isVisible() )
{
m_subWindow->show();
m_subWindow->raise();
effect()->controls()->setViewVisible( true );
}
else
{
m_subWindow->hide();
effect()->controls()->setViewVisible( false );
}
}
}
开发者ID:GNUMariano,项目名称:lmms,代码行数:17,代码来源:EffectView.cpp
示例13: hit
//Fonction qui calcule les dommages d'une attaque du pokemon 1 sur le pokemon 2, et l'affiche
int hit (Attaque att, Pokemon pok1, Pokemon pok2)
{
//Divise par 2 pour contrer le fois 2 de effect
int N = effect(pok2, att) * (pok1.ATK + att.Force) / (2 * pok2.DEF);
printf("%s a utilise %s.\n", pok1.Nom, att.Nom);
//Affiche l'efficacité de l'attaque
if (effect(pok2, att) == 4)
{
printf("C'est tres efficace !\n");
}
else if (effect(pok2, att) == 1)
{
printf("Ce n'est pas tres efficace.\n");
}
printf("%s a pris %d points de dégats.\n\n", pok2.Nom, N);
return(N);
}
开发者ID:Hallot,项目名称:Pokemon,代码行数:18,代码来源:PokemonArena.c
示例14: ai_hey_spawner
void ai_hey_spawner(Object *o)
{
if (!o->state)
{
effect(o->x, o->y - (8<<CSF), EFFECT_HEY);
o->state = 1;
}
}
开发者ID:Fordi,项目名称:nxengine-evo,代码行数:8,代码来源:weed.cpp
示例15: isCandidateForAnimationOnCompositor
bool Animation::isCandidateForAnimationOnCompositor(double playerPlaybackRate) const
{
if (!effect()
|| !m_target
|| (m_target->renderStyle() && m_target->renderStyle()->hasMotionPath()))
return false;
return CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(specifiedTiming(), *effect(), playerPlaybackRate);
}
开发者ID:eth-srl,项目名称:BlinkER,代码行数:9,代码来源:Animation.cpp
示例16: ai_minicore_shot
void ai_minicore_shot(Object *o)
{
if (++o->timer2 > 150)
{
effect(o->CenterX(), o->CenterY(), EFFECT_FISHY);
o->Delete();
}
ai_animate2(o);
}
开发者ID:EXL,项目名称:NXEngine,代码行数:10,代码来源:core.cpp
示例17: att_AI_min
//Fonction attaque de l'AI qui cherche le minimum de dommage
Attaque att_AI_min (Pokemon pok1, Pokemon pok2)
{
int i;
int res = effect(pok2, pok1.Attaques[0]) * (pok1.ATK + pok1.Attaques[0].Force) / (2 * pok2.DEF);
int j = 0;
int hit = 0;
//
for (i = 1; i < 4; i++)
{
hit = effect(pok2, pok1.Attaques[i]) * (pok1.ATK + pok1.Attaques[i].Force) / (2 * pok2.DEF);
if (min(res, hit) != res)
{
res = hit;
j = i;
}
}
//Renvoie l'attaque la plus faible
return(pok1.Attaques[j]);
}
开发者ID:Hallot,项目名称:Pokemon,代码行数:20,代码来源:PokemonArena.c
示例18: ai_ironh_brick
void ai_ironh_brick(Object *o)
{
if (!o->state)
{
int r = random(0, 9);
if (r == 9)
{
o->sprite = SPR_IRONH_BIGBRICK;
}
else
{
o->sprite = SPR_IRONH_BRICK;
o->frame = r;
}
o->xinertia = random(0x100, 0x200);
o->xinertia *= (o->dir == LEFT) ? -2 : 2;
o->yinertia = random(-0x200, 0x200);
o->state = 1;
}
// bounce off the walls
if (o->yinertia < 0 && o->y <= (16<<CSF))
{
effect(o->CenterX(), o->y, EFFECT_BONKPLUS);
o->yinertia = -o->yinertia;
}
if (o->yinertia > 0 && (o->Bottom() >= (239<<CSF)))
{
effect(o->CenterX(), o->Bottom(), EFFECT_BONKPLUS);
o->yinertia = -o->yinertia;
}
if ((o->xinertia < 0 && (o->x < -0x2000)) ||\
(o->x > (map.xsize * TILE_W) << CSF))
{
o->Delete();
}
}
开发者ID:Fordi,项目名称:nxengine-evo,代码行数:42,代码来源:ironhead.cpp
示例19: while
void ScriptRunner::run() {
uint8_t command;
const uint8_t* pos = script;
while (true) {
command = *(pos++);
if (command == CODE_END) {
pos = script;
break;
}
switch (command) {
case CODE_RATE:
runner.set_delay(*(pos++));
break;
case CODE_HSCROLL: {
PString text(pos++);
HScrollEffect effect(runner.get_display(), font_jiffy, text, true);
runner.show(effect);
pos += text.size();
} break;
case CODE_LEFT: {
PString text(pos++);
LeftEffect effect(runner.get_display(), font_jiffy, text);
runner.show(effect);
pos += text.size();
} break;
case CODE_SLEEP: {
uint16_t cycles = *(pos++);
cycles <<= 8;
cycles |= *(pos++);
cycles /= runner.get_delay();
DelayEffect effect(runner.get_display(), cycles);
runner.show(effect);
} break;
case CODE_BITMAP: {
BitmapEffect effect(runner.get_display(), pos);
runner.show(effect);
pos += 32;
} break;
}
}
}
开发者ID:33d,项目名称:jy-mcu-3208,代码行数:42,代码来源:scriptrunner.cpp
示例20: effect
bool NyquistEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxString & path)
{
NyquistEffect effect(path);
if (effect.IsOk())
{
pm.RegisterPlugin(this, &effect);
return true;
}
return false;
}
开发者ID:AthiVarathan,项目名称:audacity,代码行数:11,代码来源:LoadNyquist.cpp
注:本文中的effect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论