- WaypointSprite_Spawn("flagcarrier", 0, 0, player, '0 0 64', world, player.team, player, wps_flagcarrier, FALSE, RADARICON_FLAG, '1 1 0'); // (COLOR_TEAM1 + COLOR_TEAM2 - flag.team)
- WaypointSprite_UpdateMaxHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent) * 2);
- WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent));
- WaypointSprite_UpdateTeamRadar(player.wps_flagcarrier, RADARICON_FLAGCARRIER, '1 1 0');
- WaypointSprite_Ping(player.wps_flagcarrier);
-}
-
-void ctf_Handle_Pickup_Dropped(entity flag, entity player)
-{
- // declarations
- float returnscore = (autocvar_g_ctf_flag_returntime ? bound(0, ((flag.ctf_droptime + autocvar_g_ctf_flag_returntime) - time) / autocvar_g_ctf_flag_returntime, 1) : 1);
-
- // attach the flag to the player
- flag.owner = player;
- player.flagcarried = flag;
- setattachment(flag, player, "");
- setorigin(flag, FLAG_CARRY_OFFSET);
-
- // set up the flag
- flag.movetype = MOVETYPE_NONE;
- flag.takedamage = DAMAGE_NO;
- flag.health = flag.max_flag_health;
- flag.solid = SOLID_NOT;
- flag.angles = '0 0 0';
- //flag.ctf_pickuptime = time; // don't update pickuptime since this isn't a real steal.
- flag.ctf_carrier = player;
- flag.ctf_status = FLAG_CARRY;
-
- // messages and sounds
- Send_KillNotification(player.netname, flag.netname, "", INFO_PICKUPFLAG, MSG_INFO);
- sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE);
- ctf_EventLog("pickup", flag.team, player);
- ctf_AnnounceStolenFlag(flag, player);
-
- // scoring
- returnscore = floor((ctf_ReadScore("score_pickup_dropped_late") * (1-returnscore) + ctf_ReadScore("score_pickup_dropped_early") * returnscore) + 0.5);
- print("score is ", ftos(returnscore), "\n");
- PlayerTeamScore_AddScore(player, returnscore);
- PlayerScore_Add(player, SP_CTF_PICKUPS, 1);
-
- // effects
- if(autocvar_g_ctf_flag_pickup_effects) // field pickup effect
- {
- pointparticles(particleeffectnum("smoke_ring"), 0.5 * (flag.absmin + flag.absmax), '0 0 0', 1);
- }
-
- // waypoints
- WaypointSprite_Kill(flag.wps_flagdropped);
- WaypointSprite_Spawn("flagcarrier", 0, 0, player, '0 0 64', world, player.team, player, wps_flagcarrier, FALSE, RADARICON_FLAG, '1 1 0'); // (COLOR_TEAM1 + COLOR_TEAM2 - flag.team)
- WaypointSprite_UpdateMaxHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent) * 2);
- WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent));
- WaypointSprite_UpdateTeamRadar(player.wps_flagcarrier, RADARICON_FLAGCARRIER, '1 1 0');